Merge pull request #230 from sgibson91/dependabot-docker-docker-83464… #171
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 Image | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
concurrency: image-build | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
environment: image_build | |
steps: | |
- name: Parse image tag | |
id: parse_image_tag | |
shell: python | |
run: | | |
tag = "${{ github.ref_name }}".replace("/", "-") | |
print(f"::set-output name=image_tag::{tag}") | |
- name: Echo tag | |
run: | | |
echo "${{ steps.parse_image_tag.outputs.image_tag }}" | |
- name: Login to Quay.io | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: quay.io/${{ github.repository }}:${{ steps.parse_image_tag.outputs.image_tag }} |