-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.06 KB
/
markdown_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
---
name: Generate and deploy markdown
on: [push]
env:
CLONE_DIR: clone_dir
MARKDOWN_FILE: README.md
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-20.04
environment: markdown_deployment
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Clone markdown repo
uses: actions/checkout@v2
with:
repository: 'tada-team/tdproto-markdown'
ssh-key: ${{ secrets.MARKDOWN_DEPLOY_KEY }}
path: 'clone_dir'
- name: Generate markdown
run: |
go run ./codegen/markdown/ > "$CLONE_DIR"/"$MARKDOWN_FILE"
- name: Commit and upload markdown
if: github.ref == 'refs/heads/master'
run: |
cd "$CLONE_DIR"
git add "$MARKDOWN_FILE"
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
git commit -m "Generate markdown on $(date)" --allow-empty
git push