Skip to content

Merge pull request #3 from RedHatInsights/dependabot/github_actions/a… #3

Merge pull request #3 from RedHatInsights/dependabot/github_actions/a…

Merge pull request #3 from RedHatInsights/dependabot/github_actions/a… #3

Workflow file for this run

name: Push Image
on:
push:
branches:
- 'main'
jobs:
# make sure tests run first and only publish when they succeed
run-tests:
uses: ./.github/workflows/build-test.yml
publish-to-quay:
needs: run-tests
if: github.repository == 'RedHatInsights/insights-rebac'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short git commit SHA
id: calc-short-sha
run: |
calculatedSha=$(git rev-parse --short=7 ${{ github.sha }})
echo "SHORT_SHA=$calculatedSha" >> "$GITHUB_OUTPUT"
- name: Confirm git commit SHA output
run: echo ${{ steps.calc-short-sha.outputs.SHORT_SHA }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: true
tags: |
quay.io/ciam_authz/insights-rebac:latest,
quay.io/ciam_authz/insights-rebac:gh-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.calc-short-sha.outputs.SHORT_SHA }}