-
Notifications
You must be signed in to change notification settings - Fork 104
49 lines (49 loc) · 1.98 KB
/
publish-site.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
47
48
49
name: Publish Site
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
publish:
name: Publish Site
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install Dependencies
run: |
sudo apt-get update -y
sudo apt-get install --fix-missing -y lua-ldoc lua-markdown jq p7zip-full libsdl2-2.0-0 libopenal1
- name: Checkout Source Repository
uses: actions/checkout@v2
with:
ref: BAR105
- name: Generate Dynamic Content
run: |
bash doc/site/_scripts/get_release_data.sh
bash doc/site/_scripts/get_engine_data.sh
git add -f doc/site/_data
- name: Run LDoc
run: |
ldoc -c doc/LDoc/config.ld .
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -f doc/site/ldoc
git commit -m "Update doc/site"
- name: Check if gh-pages exists
id: check-ghpages
run: |
git fetch origin gh-pages
git ls-remote --exit-code . origin/gh-pages && (echo "exists=true" > $GITHUB_OUTPUT) || (echo "exists=false" > $GITHUB_OUTPUT)
- name: Check changes to doc/site
id: site-changes
if: steps.check-ghpages.outputs.exists == 'true'
run: |
git diff --stat origin/gh-pages BAR105:doc/site
git diff --quiet origin/gh-pages BAR105:doc/site && (echo "modified=false" > $GITHUB_OUTPUT) || (echo "modified=true" > $GITHUB_OUTPUT)
- name: Push gh-pages # Only push gh-pages if doc/site/ was changed or ldoc did changes
if: steps.check-ghpages.outputs.exists == 'false' || steps.site-changes.outputs.modified == 'true'
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git subtree split --prefix=doc/site --rejoin -b gh-pages
git push origin gh-pages --force