From 36a151e6cd3cd62e4df68cb37cc51b3bc5f13e1e Mon Sep 17 00:00:00 2001 From: Chuian Date: Thu, 1 Feb 2024 14:59:18 +0800 Subject: [PATCH] add some setup --- .github/workflows/node.js.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d67ada2..2ecf3c3 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,12 +1,13 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs -name: Node.js CI +name: Build static content and deploy to Pages # https://github.com/actions/toolkit/issues/952 permissions: - id-token: write + contents: read pages: write + id-token: write on: push: @@ -14,6 +15,12 @@ on: pull_request: branches: [ "econ-sense-vite-press" ] +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: # Build job build: @@ -27,6 +34,8 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: @@ -34,14 +43,11 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build --if-present - - name: Upload artifact id: upload-artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-pages-artifact@v3 with: - name: github-pages path: .vitepress/dist/ - if-no-files-found: error # Deployment job deploy: