Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JianzheXiao authored Jul 30, 2024
1 parent 1365c7d commit ab6a08b
Showing 1 changed file with 28 additions and 44 deletions.
72 changes: 28 additions & 44 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab6a08b

Please sign in to comment.