generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 2.41 KB
/
build_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
61
62
63
64
65
66
67
68
69
name: Build Base Images
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build-images:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './images'
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: test version get
id: version
run: |
sudo apt install ack
echo "IMAGE_VERSION=$(echo $(ack -o '^version.*:\K.*$' ../charts/api/Chart.yaml | sed 's/^ //g' | sed 's/ $//g'))" >> $GITHUB_OUTPUT
- name: 'Echo test'
run: |
echo $CHART_VERSION
env:
CHART_VERSION: ${{ steps.version.outputs.IMAGE_VERSION }}
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 'Build test image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/test:do_not_use -f Dockerfile-alpine .
docker push ghcr.io/cfpb/regtech/sbl/test:do_not_use
- name: 'Build alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/alpine:3.18_${{github.run_attempt}} -f Dockerfile-alpine .
- name: 'Build python-alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/python-alpine:3.12_${{github.run_attempt}} -f Dockerfile-python-alpine .
- name: 'Build nginx-alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/nginx-alpine:1.27_${{github.run_attempt}} -f Dockerfile-nginx-alpine .
- name: 'Build node-js-alpine image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/node-js-alpine:3.20_${{github.run_attempt}} -f Dockerfile-node-js-alpine .
- name: 'Build python-ubi8 image'
run: |
docker build -t ghcr.io/cfpb/regtech/sbl/python-ubi8:3.12_${{github.run_attempt}} -f Dockerfile-python-ubi8 .
# Github api reference only.
# We would need to use a dedicted user PAT since auto-generated GITHUB_TOKEN is not org admin which is required for delete
# - name: 'Delete test package'
# run: |
# curl -L -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/orgs/cfpb/packages/container/regtech%2Fsbl%2Ftest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}