-
Notifications
You must be signed in to change notification settings - Fork 26
44 lines (38 loc) · 1.51 KB
/
docs.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
name: Update docs
on:
push:
branches:
- main
- "release/**"
schedule:
# https://crontab.guru/#3_21_*_*_6
- cron: "3 21 * * 6"
jobs:
build:
runs-on: ubuntu-latest
# don't run this in forks, because contributors maybe don't have forked the docs repository
# also don't run when this run is caused by dependabot because then we won't have access to the ssh key secret
if: startsWith(github.repository, 'codeoverflow-org') && github.actor != 'dependabot[bot]'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.10.8
- uses: actions/checkout@v4
- name: Checkout docs
uses: actions/checkout@v4
with:
repository: codeoverflow-org/nodecg-io-docs
path: docs
ssh-key: ${{ secrets.DOCS_SSH_KEY }}
ref: ${{ github.ref }}
- name: Build docs
run: python .scripts/build-docs.py
- name: GitHub Push
run: |
cd docs
git config --global user.email "<>"
git config --global user.name "codeoverflow-org"
git add .
git diff-index --quiet HEAD || git commit --message "Update generated documentation (codeoverflow-org/nodecg-io@${{ github.sha }})"
git push origin "${GITHUB_REF#refs/heads/}"