Skip to content

Commit

Permalink
9
Browse files Browse the repository at this point in the history
  • Loading branch information
b9348 committed Feb 6, 2025
1 parent 8b218c7 commit 8d38116
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ name: Deploy to GitHub Pages

on:
push:
branches:
- main # 或者你想要触发部署的其他分支
branches: [ "main" ]

jobs:
deploy:
build-and-deploy:
runs-on: ubuntu-latest

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

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: 20

- name: Install dependencies
run: npm install
run: npm ci

- name: Build the project
- name: Build for GitHub Pages
run: npm run build:gh

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: JamesIves/github-pages-deploy-action@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages
branch: gh-pages
folder: dist
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8d38116

Please sign in to comment.