From a7be146dad4c34b7c993de5d494a10eb948f2bd5 Mon Sep 17 00:00:00 2001 From: "Benjamin D. Brodie" <113984758+bdb-dd@users.noreply.github.com> Date: Wed, 3 Jul 2024 13:20:08 +0200 Subject: [PATCH] Create an auto-deploy file --- ...r-cea30422-1c6b-49f2-bf55-cb40dfe8a892.yml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/assistants-slack-digdir-AutoDeployTrigger-cea30422-1c6b-49f2-bf55-cb40dfe8a892.yml diff --git a/.github/workflows/assistants-slack-digdir-AutoDeployTrigger-cea30422-1c6b-49f2-bf55-cb40dfe8a892.yml b/.github/workflows/assistants-slack-digdir-AutoDeployTrigger-cea30422-1c6b-49f2-bf55-cb40dfe8a892.yml new file mode 100644 index 0000000..90e5886 --- /dev/null +++ b/.github/workflows/assistants-slack-digdir-AutoDeployTrigger-cea30422-1c6b-49f2-bf55-cb40dfe8a892.yml @@ -0,0 +1,47 @@ +name: Trigger auto deployment for assistants-slack-digdir + +# When this action will be executed +on: + # Automatically trigger it when detected changes in repo + push: + branches: + [ main ] + paths: + - '**' + - '.github/workflows/assistants-slack-digdir-AutoDeployTrigger-cea30422-1c6b-49f2-bf55-cb40dfe8a892.yml' + + # Allow manual trigger + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + id-token: write #This is required for requesting the OIDC JWT Token + contents: read #Required when GH token is used to authenticate with private repo + + steps: + - name: Checkout to the branch + uses: actions/checkout@v2 + + - name: Azure Login + uses: azure/login@v1 + with: + client-id: ${{ secrets.ASSISTANTSSLACKDIGDIR_AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.ASSISTANTSSLACKDIGDIR_AZURE_TENANT_ID }} + subscription-id: ${{ secrets.ASSISTANTSSLACKDIGDIR_AZURE_SUBSCRIPTION_ID }} + + - name: Build and push container image to registry + uses: azure/container-apps-deploy-action@v2 + with: + appSourcePath: ${{ github.workspace }} + registryUrl: altinnaicontainers.azurecr.io + registryUsername: ${{ secrets.ASSISTANTSSLACKDIGDIR_REGISTRY_USERNAME }} + registryPassword: ${{ secrets.ASSISTANTSSLACKDIGDIR_REGISTRY_PASSWORD }} + containerAppName: assistants-slack-digdir + resourceGroup: assistants-prod-norwayeast + imageToBuild: altinnaicontainers.azurecr.io/assistants-slack-digdir:${{ github.sha }} + _buildArgumentsKey_: | + _buildArgumentsValues_ + +