Refactor hydro reservoir levels check #3060
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |