-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 1.93 KB
/
build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
repository_dispatch:
types: [content-update]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Check if secret is available
run: |
if [[ -z "${{ secrets.BOT_PAT }}" ]]; then echo "Secret is not set or is empty" else echo "Secret is set" fi
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PAT }}
submodules: recursive
- name: Get Branch Name
shell: bash
run: echo "::set-output name=name::$(bash scripts/branchname.sh)"
id: branch
- name: Build UI
id: ui-build
run: make ui.build
- name: Build Documentation
id: antora-build
run: |
make antora.build
touch build/site/.nojekyll
- name: Check for Invalid References
id: invalid-refs
run: bash scripts/invalid_refs.sh || true
- name: Modify Paths
id: post-process
run: bash scripts/remove_path.sh "online-guides/main"
- name: Deploy to Github Pages
id: deploy-gh
if: success() && steps.branch.outputs.name == 'master'
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: build/site
keep_history: false
fqdn: ${{ secrets.FQDN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Attach Build Files as Artifact
uses: actions/upload-artifact@v3
with:
name: html-pack
path: build/site/
# - name: Set Redirects
# id: set-redirects
# if: success() && steps.branch.outputs.name == 'master'
# run: bash scripts/redirect_renames.sh
# env:
# BOT_USER: ${{ secrets.BOT_USER }}
# BOT_EMAIL: ${{ secrets.BOT_EMAIL }}
# BOT_TOKEN: ${{ secrets.BOT_PAT }}