Skip to content

Commit

Permalink
action
Browse files Browse the repository at this point in the history
  • Loading branch information
zxcvbnmzsedr committed Dec 21, 2024
1 parent 23da765 commit 2f5ac79
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main # 设置要触发部署的分支
workflow_dispatch: # 允许手动触发部署

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

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

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install Dependencies
run: npm install

- name: Build
run: npm run build

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

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist' # 确保这里的路径与您的构建输出目录相匹配

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 2f5ac79

Please sign in to comment.