-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e53e5b6
commit ea37632
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: auto deploy 🚀 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
|
||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
# 安装 pnpm | ||
- name: Install pnpm | ||
run: npm install pnpm -g | ||
|
||
# 安装依赖 | ||
- name: Install dependencies | ||
run: pnpm i | ||
|
||
# 打包 | ||
- name: Build application 🔧 | ||
run: pnpm run build | ||
|
||
# 部署 https://github.com/JamesIves/github-pages-deploy-action | ||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: gh-pages | ||
folder: dist | ||
clean: true |