Skip to content

Commit

Permalink
initial image build and publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thetoolsmith committed Dec 27, 2024
1 parent 001a094 commit bea9b0c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
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

0 comments on commit bea9b0c

Please sign in to comment.