Ci updates (#10) #24
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: 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 }} |