generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 2.99 KB
/
build_and_publish_images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build and Publish Base Images
on:
push:
branches:
- main
schedule:
- cron: "0 5 * * Sun"
jobs:
build-publish-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './images'
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 'Build and Publish alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/alpine:v3.18.0 -f Dockerfile-alpine .
docker tag ghcr.io/cfpb/regtech/sbl/alpine:v3.18.0 ghcr.io/cfpb/regtech/sbl/alpine:v3.18.0_${{github.run_number}}.${{github.run_attempt}}
docker tag ghcr.io/cfpb/regtech/sbl/alpine:v3.18.0 ghcr.io/cfpb/regtech/sbl/alpine:latest
docker push ghcr.io/cfpb/regtech/sbl/alpine --all-tags
- name: 'Build and Publish python-alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/python-alpine:v3.12.0 -f Dockerfile-python-alpine .
docker tag ghcr.io/cfpb/regtech/sbl/python-alpine:v3.12.0 ghcr.io/cfpb/regtech/sbl/python-alpine:v3.12.0_${{github.run_number}}.${{github.run_attempt}}
docker tag ghcr.io/cfpb/regtech/sbl/python-alpine:v3.12.0 ghcr.io/cfpb/regtech/sbl/python-alpine:latest
docker push ghcr.io/cfpb/regtech/sbl/python-alpine --all-tags
- name: 'Build and Publish nginx-alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/nginx-alpine:v1.27.0 -f Dockerfile-nginx-alpine .
docker tag ghcr.io/cfpb/regtech/sbl/nginx-alpine:v1.27.0 ghcr.io/cfpb/regtech/sbl/nginx-alpine:v1.27.0_${{github.run_number}}.${{github.run_attempt}}
docker tag ghcr.io/cfpb/regtech/sbl/nginx-alpine:v1.27.0 ghcr.io/cfpb/regtech/sbl/nginx-alpine:latest
docker push ghcr.io/cfpb/regtech/sbl/nginx-alpine --all-tags
- name: 'Build and Publish node-js-alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/node-js-alpine:v3.20.0 -f Dockerfile-node-js-alpine .
docker tag ghcr.io/cfpb/regtech/sbl/node-js-alpine:v3.20.0 ghcr.io/cfpb/regtech/sbl/node-js-alpine:v3.20.0_${{github.run_number}}.${{github.run_attempt}}
docker tag ghcr.io/cfpb/regtech/sbl/node-js-alpine:v3.20.0 ghcr.io/cfpb/regtech/sbl/node-js-alpine:latest
docker push ghcr.io/cfpb/regtech/sbl/node-js-alpine --all-tags
- name: 'Build and Publish python-ubi8 image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/python-ubi8:v3.12.0 -f Dockerfile-python-ubi8 .
docker tag ghcr.io/cfpb/regtech/sbl/python-ubi8:v3.12.0 ghcr.io/cfpb/regtech/sbl/python-ubi8:v3.12.0_${{github.run_number}}.${{github.run_attempt}}
docker tag ghcr.io/cfpb/regtech/sbl/python-ubi8:v3.12.0 ghcr.io/cfpb/regtech/sbl/python-ubi8:latest
docker push ghcr.io/cfpb/regtech/sbl/python-ubi8 --all-tags