-
Notifications
You must be signed in to change notification settings - Fork 17
43 lines (41 loc) · 1.37 KB
/
push-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 }}