diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml index 89ded0b..55c7dd4 100644 --- a/.github/workflows/azure-staticwebapp.yml +++ b/.github/workflows/azure-staticwebapp.yml @@ -25,6 +25,7 @@ env: API_LOCATION: "" # location of your api source code - optional APP_ARTIFACT_LOCATION: "" # location of client code build output AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app + SKIP_APP_BUILD: true permissions: contents: read @@ -49,15 +50,40 @@ jobs: submodules: true - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3 + name: Use Node.js ${{ matrix.node-version }} with: node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm i - - run: npm run build --if-present -# - run: npm test + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Use pnpm to build + run: pnpm run build + +# - name: post-build test +# run: pnpm test - name: Deploy build artifacts to Azure id: builddeploy @@ -71,7 +97,7 @@ jobs: app_location: ${{ env.APP_LOCATION }} api_location: ${{ env.API_LOCATION }} app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} - skip_app_build: true + skip_app_build: ${{ env.SKIP_APP_BUILD }} #comment this out to use azure oryx build ###### End of Repository/Build Configurations ###### close_pull_request_job: