From 6ea04561a3643e10214c5374cd3fdd380b5e28d4 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 28 Dec 2024 21:46:17 +0000 Subject: [PATCH] ci: update azure deploy config --- ...ic-web-apps-delightful-cliff-0acdaf71e.yml | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-delightful-cliff-0acdaf71e.yml b/.github/workflows/azure-static-web-apps-delightful-cliff-0acdaf71e.yml index 7835bfb..6a92bfc 100644 --- a/.github/workflows/azure-static-web-apps-delightful-cliff-0acdaf71e.yml +++ b/.github/workflows/azure-static-web-apps-delightful-cliff-0acdaf71e.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - renovate/* pull_request: types: [opened, synchronize, reopened, closed] branches: @@ -15,29 +14,37 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') runs-on: ubuntu-latest name: Build and Deploy Job + permissions: + id-token: write + contents: read steps: - uses: actions/checkout@v4 with: submodules: true lfs: false + - name: Install OIDC Client from Core Package + run: npm install @actions/core@1.6.0 @actions/http-client + - name: Get Id Token + uses: actions/github-script@v6 + id: idtoken + with: + script: | + const coredemo = require('@actions/core') + return await coredemo.getIDToken() + result-encoding: string - name: Build And Deploy id: builddeploy uses: Azure/static-web-apps-deploy@v1 - env: - PRE_BUILD_COMMAND: corepack enable - CUSTOM_BUILD_COMMAND: pnpm install && pnpm build || true - NODE_VERSION: 18.17.1 - AZURE_STORAGE_ACCOUNT_KEY: ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_DELIGHTFUL_CLIFF_0ACDAF71E }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: upload - # ##### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: / # App source code path - api_location: .output/server # Api source code path - optional - output_location: .output/public # Built app content directory - optional - # ##### End of Repository/Build Configurations ###### + app_location: "/" # App source code path + api_location: ".output/server" # Api source code path - optional + output_location: ".output/public" # Built app content directory - optional + github_id_token: ${{ steps.idtoken.outputs.result }} + ###### End of Repository/Build Configurations ###### - name: Clear Cloudflare cache uses: Cyb3r-Jak3/action-cloudflare-cache@v2.0.0 @@ -54,5 +61,4 @@ jobs: id: closepullrequest uses: Azure/static-web-apps-deploy@v1 with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_DELIGHTFUL_CLIFF_0ACDAF71E }} - action: close + action: "close"