Skip to content

Commit

Permalink
DEVOPS-TASK-77: fix part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
evmos-lde committed Oct 13, 2023
1 parent f47f70a commit 502a0e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and publish Docker images to GCR
name: Build and publish Docker images to GitHub Container Registry

on:
push:
Expand Down Expand Up @@ -79,7 +79,8 @@ jobs:
PATCH_ENV="unknown" # Default value
case $GITHUB_REF in
refs/tags/*)
BRANCH=$(git branch --contains $GITHUB_SHA | sed 's/ *origin\///' | grep -v "HEAD" | grep main)
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref }})
BRANCH=$(git branch -r --contains $TAG_COMMIT | sed 's/ *origin\///' | grep -v "HEAD" | grep "main")
if [ "$BRANCH" == "main" ]; then
PATCH_ENV="production"
fi
Expand Down Expand Up @@ -211,7 +212,7 @@ jobs:
path: metadata-${{ matrix.component.name }}.txt

update-deployment-tags:
if: always() && needs.set-environment.outputs.env-variable != 'unknown'
if: always() && (needs.set-environment.outputs.env-variable != 'unknown' && needs.set-environment.outputs.env-variable != '')
needs: [set-environment,build,retag-and-push]
runs-on: ubuntu-latest
environment:
Expand Down

0 comments on commit 502a0e0

Please sign in to comment.