From b0f7ab3282ff799ad393a35640434e566410d2aa Mon Sep 17 00:00:00 2001 From: Carrotzpc Date: Wed, 10 Jan 2024 15:28:06 +0800 Subject: [PATCH] ci: support deploy to github pages --- .github/workflows/deploy-ghpages.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 1 + 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/deploy-ghpages.yml diff --git a/.github/workflows/deploy-ghpages.yml b/.github/workflows/deploy-ghpages.yml new file mode 100644 index 0000000..cae07b1 --- /dev/null +++ b/.github/workflows/deploy-ghpages.yml @@ -0,0 +1,45 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - beta + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on + +jobs: + deploy: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js v18.x + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: pnpm + + - name: Install pnpm v8.x + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Install deps + run: pnpm i + + - name: Build website + run: npm run docs:build + + # Popular action to deploy to GitHub Pages: + # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GH_TOKEN }} + publish_dir: ./dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11d6b44..d0fd9ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18 + cache: pnpm - name: Install pnpm v8.x uses: pnpm/action-setup@v2