Browse Source

添加 'azure/.github/workflows'

天问 4 years ago
parent
commit
b2b8576090
1 changed files with 24 additions and 0 deletions
  1. 24 0
      azure/.github/workflows

+ 24 - 0
azure/.github/workflows

@@ -0,0 +1,24 @@
+name: Deploy app container to Azure
+runs-on: ubuntu-latest
+needs: Build-Docker-Image
+steps:
+- name: "Login via Azure CLI"
+uses: azure/login@v1
+with:
+creds: ${{ secrets.AZURE_CREDENTIALS }}
+
+- uses: azure/docker-login@v1
+with:
+login-server: ${{env.IMAGE_REGISTRY_URL}}
+username: ${{ github.actor }}
+password: ${{ secrets.GITHUB_TOKEN }}
+
+- name: Deploy web app container
+uses: azure/webapps-container-deploy@v1
+with:
+app-name: ${{env.AZURE_WEBAPP_NAME}}
+images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}}:${{ github.sha }}
+
+- name: Azure logout
+run: |
+az logout