generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial image build and publish workflow
- Loading branch information
1 parent
001a094
commit bea9b0c
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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,41 @@ | ||
name: Build Images | ||
|
||
on: | ||
pull_request: | ||
workflow_run: | ||
workflows: ["Coverage"] | ||
types: | ||
- completed | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: 'Checkout GitHub Action' | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Build Image' | ||
id: build | ||
run: | | ||
docker build -t ghcr.io/cfpb/regtech/sbl/regtech-mail-api:latest -f Dockerfile . | ||
- name: 'Login to GitHub Container Registry' | ||
id: login | ||
uses: docker/login-action@v3 | ||
if: steps.build.conclusion == 'success' | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: 'Publish Image' | ||
id: publish | ||
if: github.ref == 'refs/heads/main' && steps.login.conclusion == 'success' | ||
run: | | ||
docker push ghcr.io/cfpb/regtech/sbl/regtech-mail-api --all-tags | ||