-
Notifications
You must be signed in to change notification settings - Fork 24
77 lines (63 loc) · 1.81 KB
/
build-userguide.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
name: Build Userguide pdf
on:
release:
types: [created]
push:
branches:
- release/*
- feature/*
- features/*
- fix/*
- issue-*
- doc/*
- dependabot/*
workflow_call:
inputs:
run-tests:
required: true
type: string
target_branch:
required: true
type: string
env:
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}
jobs:
build:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_branch}}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install -r requirements-doc.txt
- name: Install libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install latexmk texlive-latex-recommended texlive-formats-extra
- name: Generate PDF for user-guide
shell: bash
run: |
PDF_NAME=antares-general-reference-guide.pdf
cd docs/pdf-doc-generation-with-sphinx
bash create_pdf_doc.sh $PDF_NAME
echo "PDF_PATH=docs/pdf-doc-generation-with-sphinx/$PDF_NAME" >> $GITHUB_ENV
echo "PDF_PATH_ASSET= [\"docs/pdf-doc-generation-with-sphinx/$PDF_NAME\"]" >> $GITHUB_ENV
- name: user guide upload
uses: actions/upload-artifact@v4
with:
name: pdf-reference-guide
path: ${{ env.PDF_PATH }}
- name: Publish assets
if: ${{ env.IS_RELEASE == 'true' }}
env:
GITHUB_TOKEN: ${{ github.token }}
tag: ${{ github.event.inputs.release_tag }}
run: |
gh release upload "$tag" ${{ env.PDF_PATH }}