build: push container image after successful PR merge #10
Workflow file for this run
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
name: Build container image | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
env: | ||
TAG_NAME: ${{ github.event_name == 'push' && github.ref_name || format('pr-{0}', github.event.pull_request.number) }} | ||
jobs: | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Buildah Action | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: infinitewarp/quips | ||
tags: ${{ github.sha }} ${{ TAG_NAME }} | ||
Check failure on line 21 in .github/workflows/build.yml
|
||
containerfiles: ./compose/django/Dockerfile | ||
- name: push container image | ||
# Enable this to push *only* after the merge | ||
# if: github.event.pull_request.merged == true | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: ${{ secrets.REGISTRY }} | ||
username: ${{ secrets.REGISTRY_USERNAME }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} |