From cc12199fc6037656d6a3a2efe2539606d3726d13 Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Tue, 10 Dec 2024 09:52:29 +0100 Subject: [PATCH] ci: use inputs for deployment env --- .github/workflows/build-image.yml | 8 ++++++++ .github/workflows/release-deploy-web.yml | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 78e0ef9..a4f6674 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -8,6 +8,12 @@ on: description: 'Tag to build' required: true type: string + deployment-env: + description: 'Deployment environment' + type: choice + options: + - staging + - production concurrency: group: ${{ github.workflow }} @@ -55,5 +61,7 @@ jobs: echo "tag=$tag" >> $GITHUB_ENV - name: Build Docker image + env: + DEPLOYMENT_ENV: ${{ inputs.deployment_env }} run: | ./packages/docker/script/build.sh -r ${{ env.registry }} -t ${{ env.tag }} -a ${{ env.app }} ${{ env.force_build }} \ No newline at end of file diff --git a/.github/workflows/release-deploy-web.yml b/.github/workflows/release-deploy-web.yml index ad09f44..2c39927 100644 --- a/.github/workflows/release-deploy-web.yml +++ b/.github/workflows/release-deploy-web.yml @@ -23,10 +23,9 @@ jobs: permissions: contents: write packages: write - env: - DEPLOYMENT_ENV: staging with: tag: ${{ needs.release.outputs.version }}-beta + deployment-env: staging build-prod: needs: release @@ -36,7 +35,6 @@ jobs: permissions: contents: write packages: write - env: - DEPLOYMENT_ENV: production with: - tag: ${{ needs.release.outputs.version }} \ No newline at end of file + tag: ${{ needs.release.outputs.version }} + deployment-env: production \ No newline at end of file