-
Notifications
You must be signed in to change notification settings - Fork 255
41 lines (41 loc) · 1.13 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: deploy gh-page
on:
push:
branches: [main]
jobs:
build:
name: build and deploy gh-page
env:
COMMIT_SECRET: ${{secrets.COMMIT_SECRET}}
USER_NAME: songlh
USER_EMAIL: song.lhlh@gmail.com
PUBLISH_DIR: ./dist
GITHUB_REPOSITORY: paint-board
runs-on: ubuntu-latest
steps:
- name: checkout repository main branch
uses: actions/checkout@main
- name: with node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: npm install
run: |
npm install -g pnpm
pnpm install
- name: npm run build
run: |
pnpm build
- name: commit files
run: |
cd $PUBLISH_DIR
git init
git config --local user.name $USER_NAME
git config --local user.email $USER_EMAIL
git status
git remote add origin https://$COMMIT_SECRET@github.com/$GITHUB_REPOSITORY.git
git checkout -b gh-pages
git add --all
git commit -m "deploy to github pages"
git push origin gh-pages -f
echo deploy gh-pages complete