Skip to content

Commit

Permalink
Stop using doc branch to use github pages
Browse files Browse the repository at this point in the history
fix workflow miss
  • Loading branch information
Yang-33 committed Jun 1, 2024
1 parent 329356c commit 3fb4dde
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 34 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy static content to Pages on release

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci

- name: Build API Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
- name: Build Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

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
id: deployment
uses: actions/deploy-pages@v4
36 changes: 2 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,5 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependency
run: npm ci
- name: Config Internal Git
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Clone Doc History
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'doc-dist'
- name: Clean Doc Directory
run: |
cd doc-dist
ls | grep -v '.git' | xargs rm -r
cd ../
- name: Build API Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
- name: Build Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
- name: Copy & Deploy
run: |
cp -r docs/.vitepress/dist/* doc-dist/
cd doc-dist
git add -A
git commit -m 'Deploy docs'
git push
needs: [release-package]
use: ./.github/workflows/deploy-doc.yml

0 comments on commit 3fb4dde

Please sign in to comment.