Skip to content

Commit

Permalink
feat: script for deploying ⛏️
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderSerio committed Jun 24, 2024
1 parent 05c30de commit 8edd7d8
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy Vue Site to GitHub Pages

on:
push:
branches: [master]
workflow_dispatch:

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

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
build-and-deploy:
runs-on: ubuntu-latest
concurrency:
group: deploy
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install PNPM
run: npm install -g pnpm

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

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Dependencies in Doc Directory
working-directory: ./doc
run: pnpm install

- name: Build Vue App
working-directory: ./doc
run: pnpm run build

# 使用官方的actions/deploy-pages行动部署到GitHub Pages,但需注意actions/deploy-pages@v4并不存在,应使用其他适合的部署action
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/dist
6 changes: 6 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ set -e
cd doc

npm run build

cd dist

git init

git checkout -b

0 comments on commit 8edd7d8

Please sign in to comment.