Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker image with git sha only for pushes on main branch #79

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
push:
branches: ['*']
tags: ['*']
workflow_dispatch: {}

env:
IMG_TAGS: ${{ github.sha }} ${{ github.ref_name }}
IMG_TAGS: ${{ github.ref_name }}
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
MAIN_BRANCH_NAME: main
Expand All @@ -19,11 +20,16 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Add latest tag
- name: Add latest tag for the main branch
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
id: add-latest-tag
run: |
echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV
- name: Add git sha tag for the main branch
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
id: add-git-sha-tag
run: |
echo "IMG_TAGS=${{ github.sha }} ${{ env.IMG_TAGS }}" >> $GITHUB_ENV
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
Expand Down
Loading