generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* uncomment for PR test * create workflows dir * add scheduled run every sunday 5am * add unique image tagging, update contributing doc * keep publishing the latest image tags in addition to the build specific one. Switch unique tagging to use native github github.run_attempt property * add push to verify access to ghcr and see default visability * cannot set pub/priv at the tag level * add delete step to remove test package * add delete step to remove test package * env var syntax debug * env var syntax debug * env var syntax debug * add notes about deleting the test package * change latest to semantic versioning to make immutable * notes about immutable packages * typo * remove redundant build, change tagging strategy, notes * fix markdown
- Loading branch information
1 parent
568cb24
commit 04818af
Showing
5 changed files
with
167 additions
and
96 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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_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_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_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_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_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
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: '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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters