-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.17 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
42
43
44
45
46
47
48
49
50
51
name: Deploy
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Setup Hexo
run: |
npm install hexo-cli -g
npm install
- name: Deploy to COS
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_REGION: ${{ secrets.COS_REGION }}
run: |
hexo clean && hexo g && hexo d
- name: Deploy to Github Pages
env:
GH_REF: github.com/myloft/blog
CI_TOKEN: ${{ secrets.CI_TOKEN }}
run: |
git clone https://${GH_REF} .deploy_git
cd .deploy_git
git checkout master
cd ../
mv .deploy_git/.git/ ./public/
cd ./public
git init
git config user.name "Solyn"
git config user.email "[email protected]"
git add .
git commit -m ":memo: Update blog by Actions"
git push --force --quiet "https://${CI_TOKEN}@${GH_REF}" master:gh-pages