From 3ff82fbd1b3a5327a12112d1944fe1b7fbd79f27 Mon Sep 17 00:00:00 2001 From: Lei QIao <93187597+qiaoleiatms@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:32:51 +0800 Subject: [PATCH] Create an auto-deploy file --- ...r-952e3a82-8e57-46ea-b6f5-a8ae4e98bfbd.yml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/spring-repo-17-with-registry-AutoDeployTrigger-952e3a82-8e57-46ea-b6f5-a8ae4e98bfbd.yml diff --git a/.github/workflows/spring-repo-17-with-registry-AutoDeployTrigger-952e3a82-8e57-46ea-b6f5-a8ae4e98bfbd.yml b/.github/workflows/spring-repo-17-with-registry-AutoDeployTrigger-952e3a82-8e57-46ea-b6f5-a8ae4e98bfbd.yml new file mode 100644 index 0000000..e62fae3 --- /dev/null +++ b/.github/workflows/spring-repo-17-with-registry-AutoDeployTrigger-952e3a82-8e57-46ea-b6f5-a8ae4e98bfbd.yml @@ -0,0 +1,42 @@ +name: Trigger auto deployment for spring-repo-17-with-registry + +# When this action will be executed +on: + # Automatically trigger it when detected changes in repo + push: + branches: + [ main ] + paths: + - '**' + - '.github/workflows/spring-repo-17-with-registry-AutoDeployTrigger-952e3a82-8e57-46ea-b6f5-a8ae4e98bfbd.yml' + + # Allow manual trigger + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout to the branch + uses: actions/checkout@v2 + + - name: Azure Login + uses: azure/login@v1 + with: + creds: ${{ secrets.SPRINGREPO17WITHREGISTRY_AZURE_CREDENTIALS }} + + - name: Build and push container image to registry + uses: azure/container-apps-deploy-action@v2 + with: + appSourcePath: ${{ github.workspace }} + registryUrl: qiaoleibugbash.azurecr.io + registryUsername: ${{ secrets.SPRINGREPO17WITHREGISTRY_REGISTRY_USERNAME }} + registryPassword: ${{ secrets.SPRINGREPO17WITHREGISTRY_REGISTRY_PASSWORD }} + containerAppName: spring-repo-17-with-registry + resourceGroup: qiaolei-bugbash-rg + imageToBuild: qiaoleibugbash.azurecr.io/spring-repo-17-with-registry:${{ github.sha }} + + + +