41 lines (33 loc) · 1.06 KB
/
create-draft-blog.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
name: Create hatena draft blog
on: create
jobs:
create-blog:
name: Create draft blog
if: ${{ contains(github.ref, 'create-blog') }}
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Check out code
uses: actions/checkout@v3
- name: Replace secrets key to secrets value
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "$HATENA_API_KEY"
replace: "${{ secrets.HATENA_API_KEY }}"
include: blogsync.yaml
regex: false
- name: Setup blogsync
run: |
go install github.com/x-motemen/blogsync@v0.12.1
- name: Post hatena draft blog to hatena blog
run: |
~/go/bin/blogsync post --draft m-yamashii.hatenablog.com < draft.md
- name: Commit draft blog
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Create draft blog.
file_pattern: 'entries/**/*.md'
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>