-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (95 loc) · 2.65 KB
/
Documentation.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Documentation
on:
# manual trigger
workflow_dispatch:
# trigger from an other action
repository_dispatch:
types: [trigger-docu]
workflow_run:
workflows: [Docker]
type:
- completed
pull_request:
push:
branches:
- main
paths:
- 'docs/**'
- 'README.md'
- '.github/workflows/Documentation.yml'
tags:
- '*'
jobs:
build-fmus:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: build
uses: ./.github/actions/FMUBuild
render:
runs-on: ubuntu-latest
steps:
- name: "Check out repository"
uses: actions/checkout@v3
- name: "Install IPE and SVG"
run:
sudo apt update
sudo apt install -y ipe librsvg2-bin texlive-luatex texlive-latex-extra rename
- name: "Render ipe graphics"
run:
cd docs/src/graphics
find . -iname *.ipe -exec iperender -svg {} {}_render.svg \; -exec rsvg-convert --keep-aspect-ratio --zoom=1.83 -f svg {}_render.svg -o {}.svg \;
rename 's/(.*).ipe.svg/$1.svg/' *
rm *_render.svg
tar -czf svg.tar.gz *.svg
cd ../../..
- name: "Upload artifacts"
uses: actions/upload-artifact@v3
with:
name: svgs
path: docs/src/graphics/svg.tar.gz
build_docs:
runs-on: ubuntu-latest
needs:
- render
- build-fmus
env:
JULIA_NUM_THREADS: $(nproc)
steps:
- name: "Check out repository"
uses: actions/checkout@v3
- name: "Download svg artifacts"
uses: actions/download-artifact@v3
with:
name: svgs
path: docs/src/graphics
- name: "Extract svgs"
run:
tar -xzf docs/src/graphics/svg.tar.gz -C docs/src/graphics
- name: "Download FMU artifacts"
uses: actions/download-artifact@v3
with:
name: fmus
path: deps/
- name: "Extract FMU artifacts"
run:
tar -xzf deps/fmu.tar.gz -C deps
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: '1.10'
arch: x64
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-doc-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-doc-${{ env.cache-name }}-
${{ runner.os }}-doc-
${{ runner.os }}-
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}