-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 891 Bytes
/
deploy.yml
File metadata and controls
36 lines (34 loc) · 891 Bytes
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
name: Deploy
on:
push:
branches: [website]
pull_request:
branches: [website]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: npm install --no-package-lock
- name: Build static files
run: npm run build
- name: Commit files
run: |
git reset --hard
git fetch
git checkout master
rm -rf *.html *.css *.js *.xml *.txt *.json docs img statics
git config user.name "pengtikui"
git config user.email "949828390@qq.com"
cp -r ./build/* ./
git add .
git commit -m "Deploy website version based on ${{ github.sha }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}