-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (91 loc) · 3.05 KB
/
website_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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: "Build Website"
on:
workflow_call:
inputs:
publish_type:
required: true
type: string
permissions: {}
jobs:
website_publish:
permissions:
contents: write
runs-on: ubuntu-latest
if: github.event.inputs.publish_type == 'website'
steps:
- name: "Checkout `naev.org`"
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/prod
- name: "Clone `naev-website`"
uses: actions/checkout@v4
with:
repository: 'naev/naev-website'
path: ${{ github.workspace }}/staging
- name: "Setup APT Packages"
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: graphicsmagick optipng tidy
version: website_1.0
- name: "Setup ruby"
uses: ruby/setup-ruby@v1
with:
working-directory: ${{ github.workspace }}/staging
bundler-cache: true
- name: "Build Website"
run: make
working-directory: ${{ github.workspace }}/staging
- name: "Stage Updated Files"
run: rsync -avzh output/ ${{ github.workspace }}/prod
working-directory: ${{ github.workspace }}/staging
- name: "Commit Updated Files"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Website Updates"
repository: ${{ github.workspace }}/prod
docs_publish:
permissions:
contents: write
runs-on: ubuntu-latest
if: github.event.inputs.publish_type == 'docs'
container:
image: "ghcr.io/naev/naev-docs:latest"
steps:
- name: "Checkout `naev.org`"
uses: actions/checkout@v4
with:
path: /__w/naev.github.io/naev.github.io/prod
- name: "Checkout `naev`"
uses: actions/checkout@v4
with:
repository: 'naev/naev'
submodules: 'recursive'
path: /__w/naev.github.io/naev.github.io/staging
- name: "Build API Docs"
id: "build"
run: |
meson setup build . -Dexecutable=disabled
meson compile -C build
working-directory: ${{ github.workspace }}/staging
- name: "Upload Build Log"
uses: actions/upload-artifact@v4
if: ${{ success() || steps.build.outcome == 'failure' }}
with:
name: meson-build-log
path: ${{ github.workspace }}/staging/build/meson-logs/meson-log.txt
- name: "Build Manual PDF"
run: |
OLDHOME="$HOME"
export HOME="/root"
make naev_dev_manual.pdf
export HOME="$OLDHOME"
working-directory: ${{ github.workspace }}/staging/docs/manual
- name: "Stage Updated Files"
run:
cp -Ru build/docs/lua/* ../prod/api && mkdir -p ../prod/devmanual && cp docs/manual/*.pdf ../prod/devmanual
working-directory: ${{ github.workspace }}/staging
- name: "Commit Updated Files"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Documentation Updates"
repository: /__w/naev.github.io/naev.github.io/prod