Skip to content

Commit

Permalink
Normalize branch name in github actions (#840)
Browse files Browse the repository at this point in the history
* Normalize brach name WIP

* Normalize when deploying too

* Add on undeploy
  • Loading branch information
kzadurska authored Feb 18, 2022
1 parent e9b1123 commit b6b1ee6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
run: gcloud auth configure-docker --quiet

- name: Build Docker image
run: docker build . -t $IMAGE_NAME:$REF_NAME
run: docker build . -t $IMAGE_NAME:${REF_NAME//[^a-z0-9]/-}

- name: Push Docker image
run: docker push $IMAGE_NAME:$REF_NAME
run: docker push $IMAGE_NAME:${REF_NAME//[^a-z0-9]/-}

- name: Deploy app
run: |
gcloud run deploy turnilo-${REF_NAME//[^a-z0-9]/-} \
--image $IMAGE_NAME:$REF_NAME \
--image $IMAGE_NAME:${REF_NAME//[^a-z0-9]/-} \
--region europe-west1 \
--platform managed \
--allow-unauthenticated \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/undeploy-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Delete Docker image
run: |
gcloud container images delete $IMAGE_NAME:$REF_NAME --quiet
gcloud container images delete $IMAGE_NAME:${REF_NAME//[^a-z0-9]/-} --quiet

0 comments on commit b6b1ee6

Please sign in to comment.