From ab6a08ba92453757bfb262bcb61d6e78dca7e819 Mon Sep 17 00:00:00 2001 From: JianzheXiao Date: Tue, 30 Jul 2024 13:12:04 -0700 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 72 ++++++++++++++---------------------- 1 file changed, 28 insertions(+), 44 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 73cd612..d57a67a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,73 +2,57 @@ name: Deploy ByteMLPerf site to Pages on: - # Runs on pushes targeting the default branch push: - branches: ["main"] + branches: [main] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write -# 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" + group: pages cancel-in-progress: false -# Default to bash -defaults: - run: - shell: bash - jobs: + # Build job build: runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v3 - with: - version: 8 - - - name: Use Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Build - run: | - npm install - npm run build - - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Install dependencies - run: pnpm install - - name: Build with Rspress - run: | - pnpm run build - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./doc_build + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Not needed if lastUpdated is not enabled + - uses: pnpm/action-setup@v3 # pnpm is optional but recommended, you can also use npm / yarn + with: + version: 8 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Install dependencies + run: pnpm install + - name: Build with Rspress + run: | + pnpm run build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: doc_build # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest needs: build + runs-on: ubuntu-latest + name: Deploy steps: - name: Deploy to GitHub Pages id: deployment