From 3a4a174d019dd163db51f810a621897a87541f4f Mon Sep 17 00:00:00 2001 From: Yuta Matsumura Date: Sun, 24 Sep 2023 01:16:39 +0900 Subject: [PATCH] update django workflow --- .github/workflows/python-django.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-django.yml b/.github/workflows/python-django.yml index 9d24e19..b14cb6a 100644 --- a/.github/workflows/python-django.yml +++ b/.github/workflows/python-django.yml @@ -10,6 +10,11 @@ on: env: PYTHON_VERSION: '3.11' WORKING_DIRECTORY: python/django + PACKAGE_NAME: django-app + +permissions: + id-token: write + contents: read jobs: build-django: @@ -38,7 +43,7 @@ jobs: - name: Upload artifact for deployment jobs uses: actions/upload-artifact@v2 with: - name: python-app + name: ${{ env.PACKAGE_NAME }} path: | ./${{ env.WORKING_DIRECTORY }} !./${{ env.WORKING_DIRECTORY }}/venv/ @@ -54,13 +59,23 @@ jobs: - name: Download artifact from build job uses: actions/download-artifact@v2 with: - name: python-app + name: ${{ env.PACKAGE_NAME }} path: . - + + - name: Az CLI Login + uses: azure/login@v1 + with: + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v2 id: deploy-to-webapp with: app-name: ${{ vars.AZURE_WEBAPP_NAME }} slot-name: 'Production' - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.PACKAGE_NAME }} + + - name: Az CLI Logout + run: az logout