-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (40 loc) · 1.08 KB
/
deploy-gh-pages.yml
File metadata and controls
45 lines (40 loc) · 1.08 KB
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
42
43
44
45
name: deploy gh-pages
on:
push:
branches: [ main ]
jobs:
build:
name: Build and deploy gh-pages
env:
MY_SECRET : ${{secrets.commit_secret}}
USER_NAME : sirm2z
USER_EMAIL : sirm2zisv@gmail.com
PUBLISH_DIR : ./dist
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm install
- name: npm run build
run: npm run 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://$MY_SECRET@github.com/imgcook/pipboard.git
git checkout -b gh-pages
git add --all
git commit -m "deploy to Github pages"
cat CNAME
git push origin gh-pages -f
echo 🤘 deploy gh-pages complete.