From a8850c160923819627b5977740308ae55094a2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Mon, 13 May 2024 13:01:11 +0200 Subject: [PATCH 1/2] Create Actions workflow to deploy to production --- .github/workflows/build-and-deploy-prod.yml | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build-and-deploy-prod.yml diff --git a/.github/workflows/build-and-deploy-prod.yml b/.github/workflows/build-and-deploy-prod.yml new file mode 100644 index 00000000..8540aaa9 --- /dev/null +++ b/.github/workflows/build-and-deploy-prod.yml @@ -0,0 +1,35 @@ +# This workflow will build a docker image, push it to ghcr.io, and deploy it to an Azure WebApp. +name: Build and Deploy -- PROD + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + determine-trigger: + name: Determine if this was triggered by a release or workflow_dispatch + runs-on: ubuntu-latest + outputs: + is-release: ${{ env.IS_RELEASE }} + steps: + - name: Check if this was triggered by a release + id: release + run: | + echo "IS_RELEASE"=${{ github.event_name == 'release' }} >> $GITHUB_ENV + + build-and-deploy-prod: + uses: clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v1.0.0 + needs: determine-trigger + secrets: + AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} + AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PROD }} + AZURE_SECONDARY_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PROD_EU }} + DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + PRODUCTION_DEPLOYERS: ${{ secrets.PRODUCTION_DEPLOYERS }} + with: + deploy-env: prod + application-type: ui + azure-app-base-name: clearlydefined + azure-app-name-postfix: -prod + secondary-azure-app-name-postfix: -prod-europe From f414466f97076435ca3edfa753bfdba23ff1e215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Wed, 29 May 2024 17:21:53 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: E. Lynette Rayle --- .github/workflows/build-and-deploy-prod.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/build-and-deploy-prod.yml b/.github/workflows/build-and-deploy-prod.yml index 8540aaa9..10790376 100644 --- a/.github/workflows/build-and-deploy-prod.yml +++ b/.github/workflows/build-and-deploy-prod.yml @@ -7,20 +7,8 @@ on: types: [published] jobs: - determine-trigger: - name: Determine if this was triggered by a release or workflow_dispatch - runs-on: ubuntu-latest - outputs: - is-release: ${{ env.IS_RELEASE }} - steps: - - name: Check if this was triggered by a release - id: release - run: | - echo "IS_RELEASE"=${{ github.event_name == 'release' }} >> $GITHUB_ENV - build-and-deploy-prod: - uses: clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v1.0.0 - needs: determine-trigger + uses: clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v1.1.0 secrets: AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PROD }}