Skip to content

Commit 28db9f6

Browse files
committed
envrnmt from var
1 parent eb4400a commit 28db9f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
outputs:
2222
VERSION: ${{ steps.version.outputs.VERSION }}
23+
GH_ENVIRONMENT: ${{ steps.version.outputs.GH_ENVIRONMENT }}
2324
steps:
2425
- name: Define version
2526
id: version
@@ -38,10 +39,16 @@ jobs:
3839
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
3940
fi
4041
echo "set VERSION=${VERSION}"
42+
if [[ ${GITHUB_EVENT_NAME} == "push" && ${GITHUB_REF} == "refs/heads/main" ]]
43+
then
44+
export GH_ENVIRONMENT="dockerhub"
45+
else
46+
export GH_ENVIRONMENT="default"
47+
fi
4148
docker-build:
4249
runs-on: ubuntu-latest
4350
timeout-minutes: 10
44-
environment: ${ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'dockerhub' || 'default' }
51+
environment: ${{ needs.set-variables.outputs.GH_ENVIRONMENT }}
4552
needs: [set-variables]
4653
strategy:
4754
fail-fast: false

0 commit comments

Comments
 (0)