Single-HTML-Page Documentation Generation #848
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
| name: Single-HTML-Page Documentation Generation | |
| on: | |
| schedule: | |
| - cron: "0 10 * * 2-5" # Runs at 10:00 UTC on Tue, Wed, Thu, and Fri (see https://crontab.guru) | |
| - cron: "0 0 * * 1" # Runs at 00:00 UTC on Monday (also creates PR). | |
| workflow_dispatch: # Run on manual trigger | |
| jobs: | |
| generate-html: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Free space | |
| run: df -h && rm -rf /opt/hostedtoolcache* && df -h | |
| - name: Install dependencies (apt-get) | |
| run: |- | |
| sudo apt-get update | |
| wget https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
| sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
| sudo apt install -y build-essential xorg libssl-dev libxrender-dev wget | |
| wget "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb" | |
| sudo apt install -y ./wkhtmltox_0.12.6-1.bionic_amd64.deb | |
| - name: Install dependencies (pip) | |
| run: |- | |
| python -m pip install --upgrade pip | |
| pip install beautifulsoup4==4.14.3 | |
| pip install lxml==6.0.2 | |
| pip install pillow==11.1.0 | |
| pip install pdfkit==1.0.0 | |
| pip install wand==0.6.11 | |
| - name: Run Single-HTML-Page Documentation Generator | |
| run: python code-generators/SinglePageDocGenerator.py | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_KEY }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET }} | |
| aws-region: us-west-1 | |
| - name: Copy files to the S3 website content bucket | |
| run: aws s3 cp ./single-page s3://${{ secrets.AWS_BUCKET }} --recursive --acl bucket-owner-full-control --exclude "*" --include "*.pdf" --content-type "application/pdf" | |
| - name: Create Pull Request | |
| if: github.event_name == 'workflow_dispatch' || github.event.schedule == '0 0 * * 1' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| branch: github-action-single-page-doc-generator | |
| add-paths: single-page/*.html | |
| title: "Update single-page HTML documentation" | |
| body: "Automated changes from SinglePageDocGenerator.py." | |
| committer: "GitHub Actions <github-actions@github.com>" | |
| author: "GitHub Actions <github-actions@github.com>" |