Skip to content

Commit

Permalink
feat(pipeline): dynamic image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed Nov 12, 2022
1 parent cad1249 commit 4413fcc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ jobs:
- name: Set image tag global
run: |
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH"
if [ $GIT_BRANCH = "main" ]; then export TAG=latest; else export TAG=next; fi
echo "Current branch: GIT_BRANCH=$GIT_BRANCH leads to the container image tag: $TAG"
echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
echo "IMAGE_TAG=$IMAGE_TAG"
env
check-oci-config:
name: Check Containerfile
Expand Down Expand Up @@ -157,7 +155,7 @@ jobs:

build-container-image:
name: Build container image
needs: [ check-oci-config, check-repo, check-code-style, check-code, test ]
needs: [ set-image_tag, check-oci-config, check-repo, check-code-style, check-code, test ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down

0 comments on commit 4413fcc

Please sign in to comment.