Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jiazengp committed Aug 9, 2023
1 parent 04c9dfd commit d2a7037
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 30 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,22 @@ on:
push:
branches:
- main
- next

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node_version:
- 18

steps:
- name: Checkout
uses: actions/checkout@v3
with:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

- name: Set node version to ${{ matrix.node_version }}
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: 18
cache: pnpm

- name: Install dependencies
Expand Down
41 changes: 19 additions & 22 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ jobs:
docs:
runs-on: ubuntu-latest

strategy:
matrix:
node_version:
- 18

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -47,30 +42,32 @@ jobs:
with:
# choose node.js version to use
node-version: '18'
cache: pnpm

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install dependencies
uses: pnpm/action-setup@v2
with:
run_install: true

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: pnpm
# run build script
- name: Build site
run: pnpm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/.vitepress/dist

# please check out the docs of the workflow for more details
# @See https://github.com/crazy-max/ghaction-github-pages
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
# deploy to gh-pages branch
target_branch: gh-pages
# deploy the default output dir
build_dir: ./dist
env:
# @See https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit d2a7037

Please sign in to comment.