Skip to content

Commit

Permalink
chore: Update Azure CLI login credentials and actions versions in Git…
Browse files Browse the repository at this point in the history
…Hub workflows
  • Loading branch information
tsubakimoto committed Jun 30, 2024
1 parent 2e40341 commit 075dd03
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/node-nuxtjs-on-azure-app-service-with-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@ on:
workflow_dispatch:

env:
NODE_VERSION: '16.x'
WORKING_DIRECTORY: nodejs/nuxtjs
PACKAGE_NAME: node-app
ARCHIVE_NAME: nuxtjs.zip

permissions:
id-token: write
contents: read

jobs:
build-nuxtjs-zip:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ${{ env.WORKING_DIRECTORY }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: '16.x'
cache: 'npm'
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}

Expand All @@ -45,7 +46,7 @@ jobs:
working-directory: ${{ env.WORKING_DIRECTORY }}

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.WORKING_DIRECTORY }}/${{ env.ARCHIVE_NAME }}
Expand All @@ -56,18 +57,26 @@ jobs:
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}

- name: 'Deploy to Azure Web App'
- name: Az CLI Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: 'Run Azure webapp deploy action'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
app-name: ${{ vars.AZURE_WEBAPP_NAME }}-nuxtjs
slot-name: 'Production'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.ARCHIVE_NAME }}

- name: Az CLI Logout
run: az logout
37 changes: 23 additions & 14 deletions .github/workflows/node-nuxtjs-on-azure-app-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@ on:
workflow_dispatch:

env:
NODE_VERSION: '16.x'
WORKING_DIRECTORY: nodejs/nuxtjs
PACKAGE_NAME: node-app

permissions:
id-token: write
contents: read

jobs:
build-nuxtjs:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ${{ env.WORKING_DIRECTORY }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: '16.x'
cache: 'npm'
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}

Expand All @@ -37,7 +38,7 @@ jobs:
npm run test --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.WORKING_DIRECTORY }}
Expand All @@ -48,18 +49,26 @@ jobs:
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}

- name: 'Deploy to Azure Web App'
- name: Az CLI Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: 'Run Azure webapp deploy action'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
app-name: ${{ vars.AZURE_WEBAPP_NAME }}-nuxtjs
slot-name: 'Production'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: .
package: ${{ env.ARCHIVE_NAME }}

- name: Az CLI Logout
run: az logout

0 comments on commit 075dd03

Please sign in to comment.