-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.49 KB
/
docgen.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: Docgen
on:
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12.20.0
- name: Install required packages
run: npm ci
- name: Run docs generation
run: npm run docs
- name: Push
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: docs
FOLDER: docs
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "generating docs for commit: {sha}"
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Set env vars
id: vars
shell: bash
run: |
echo "::set-output name=sha_prev_short::$(git rev-parse --short HEAD)"
echo "::set-output name=sha_curr_short::$(git log -n 1 --pretty=format:"%h" origin/docs)"
- name: Trigger hash write
run: |
echo '{"hash": { "key": "coll:${{ steps.vars.outputs.sha_prev_short }}", "value": "${{ steps.vars.outputs.sha_curr_short }}" }}'
curl -X POST https://ddoo.dev/map \
-H 'Content-Type: application/json' \
-H 'Authorization: ${{ secrets.CF_KV_WRITE_TOKEN }}' \
--data '{"hash": { "key": "coll:${{ steps.vars.outputs.sha_prev_short }}", "value": "${{ steps.vars.outputs.sha_curr_short }}" }}'