Skip to content

Commit 5b54e1e

Browse files
committed
Fix build-and-trigger-deploy
Workflow trigger was misconfigured; did run when arbitrary branches or tags were created.
1 parent 3e71305 commit 5b54e1e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/build-and-trigger-deploy.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
create:
87
tags:
98
- 'v*'
109

@@ -74,17 +73,15 @@ jobs:
7473
docker push "${IID}-amd64" &&
7574
docker manifest create "${IID}" "${IID}-amd64" &&
7675
docker manifest push "${IID}" &&
77-
if [ "${GITHUB_EVENT_NAME}" = create ]; then
76+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
7877
docker manifest create "${IMAGEID}:latest" "${IID}-amd64" &&
7978
docker manifest push "${IMAGEID}:latest"
8079
fi
8180
- name: Trigger deploy
8281
run: >
83-
if [ "${GITHUB_EVENT_NAME}" = push ]; then
84-
ENV=staging
85-
REF=${GITHUB_SHA}
82+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
83+
ENV=production; REF=${GITHUB_REF}
8684
else
87-
ENV=production
88-
REF=${GITHUB_REF}
85+
ENV=staging; REF=${GITHUB_SHA}
8986
fi;
9087
curl -sd "{\"ref\":\"${REF}\",\"required_contexts\":[],\"environment\":\"${ENV}\",\"payload\":{\"version\":\"$(cat version/version)\"}}" https://api.github.com/repos/${GITHUB_REPOSITORY}/deployments -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)