-
Notifications
You must be signed in to change notification settings - Fork 26
46 lines (45 loc) · 1.26 KB
/
publish_blog_to_github_pages.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
name: Blog of hugozhu.myalert.info
on:
push:
branches: [ master ]
jobs:
checks:
name: run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Install gor
run: |
go version
go install github.com/hugozhu/gor/gor@latest
- name: Clone blog
run: |
mkdir compiled
git clone https://github.com/hugozhu/hugozhu.github.com compiled
- name: Compile blog
run: |
gor compile
- name: Publish blog
run: |
cd compiled
git status
git config --global user.name "Hugo Zhu"
git config --global user.email "hugozhu@gmail.com"
git remote set-url origin https://x-access-token:${{ secrets.TOKEN }}@github.com/hugozhu/hugozhu.github.com
git add *
git commit -m "Updated ${{ env.GITHUB_RUN_ID }}" .
git push origin
- uses: hugozhu/dingtalk-github-action@v1
with:
token: ${{ secrets.DINGTALK_TOKEN }}
title: 'Blog updated from Github action'
type: text
content: |
## Blog just updated!
> from github action message