From 809af5ee80d9d9c2f10a1cff87e9b6485f40ba22 Mon Sep 17 00:00:00 2001 From: Jeff Jacobson Date: Mon, 28 Oct 2024 09:38:41 -0700 Subject: [PATCH] Ci/fix publish (#484) * ci: :construction_worker: Updated dist to work with pnpm * ci: :construction_worker: Added test step to node.js action --- .github/workflows/node.js.yml | 10 ++++++++-- .github/workflows/publish.yaml | 23 +++++++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 065e2c31..04dbcedb 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -28,6 +28,12 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: 'pnpm' + cache: "pnpm" + + # Install project dependencies - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile --reporter append-only --prefer-offline + + - name: Test + run: pnpm test + diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5bcd7849..ce8e050e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -28,25 +28,40 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: windows-latest steps: + # Checkout your repository - name: Checkout uses: actions/checkout@v4 + + # Install pnpm + - name: Install pnpm + uses: pnpm/action-setup@v4 + + # Setup Node. Install latest version ("*") - name: Set up Node uses: actions/setup-node@v4 with: node-version: "*" - cache: "npm" + cache: "pnpm" + + # Install project dependencies - name: Install dependencies - run: npm ci - # Build with Vite build, explicitly setting the base URL. + run: pnpm install + + # Build the app - name: Build - run: npx vite build --base '/wsdot-mp-map' + run: pnpm exec vite build --base '/wsdot-mp-map' + + # Setup Github Pages - name: Setup Pages uses: actions/configure-pages@v4 + + # Upload the built app code to an artifact - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: # Upload dist folder path: "./dist" + # Deploy the artifact to Github Pages. - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4