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

DEVOPS-TASK-77: fix part 2 #70

Merged
merged 1 commit into from
Oct 13, 2023
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
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
Loading