Deploy Github Pages #1244
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Github Pages | |
on: | |
push: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ['Fetch'] | |
types: | |
- completed | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Set Timezone | |
run: sudo timedatectl set-timezone "Asia/Shanghai" | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: pnpm | |
- name: Load .env file | |
uses: xom9ikk/dotenv@v2 | |
- name: Install | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |