Build docs #273
This file contains hidden or 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
| on: | |
| schedule: | |
| - cron: "0 5 * * 0,1,2,3,4,5,6" # run every Monday day at 5AM | |
| workflow_dispatch: {} # allow running manually from the github ui | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| name: Build docs | |
| jobs: | |
| build-doc: | |
| name: Build docs | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: joda001/imagec-doc:v2.2.0 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get latest release tag from imagec | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| id: get_release | |
| run: | | |
| python3 ./scripts/read_version_information.py | |
| - name: Generate docs | |
| run: | | |
| ./build.sh | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: imagec-doc-html | |
| path: _site | |
| if-no-files-found: error | |
| release: | |
| needs: | |
| - build-doc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: imagec-doc-html | |
| path: _site | |
| - name: Upload to imagec.org | |
| env: | |
| SSH_KEY: ${{ secrets.SSH_KEY_IMAGEC }} | |
| SERVER_NAME : ${{ secrets.SERVER_NAME_IMAGEC }} | |
| run: | | |
| echo "$SSH_KEY" > ssh_key_for_github | |
| chmod 400 ssh_key_for_github | |
| scp -r -o StrictHostKeyChecking=no -i ssh_key_for_github _site/* github@$SERVER_NAME:/var/www/html/ | |
| rm -rf ssh_key_for_github |