Skip to content

Single-HTML-Page Documentation Generation #419

Single-HTML-Page Documentation Generation

Single-HTML-Page Documentation Generation #419

name: Single-HTML-Page Documentation Generation
on:
schedule:
- cron: "0 10 * * 1-5" # Runs at 10:00 UTC on Mon, Tue, Wed, Thu and Fri. (see https://crontab.guru)
workflow_dispatch: # Run on manual trigger
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Free space
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
- name: Install dependencies (apt-get)
run: |-
sudo apt-get update
wget http://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.12.2
pip install wand==0.6.11
pip install pdfkit==1.0.0
pip install pillow==9.2.0
pip install lxml==4.9.1
- name: Run Single-HTML-Page Documentation Generator
run: python code-generators/SinglePageDocGenerator.py
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
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: Push to Branch
timeout-minutes: 30
run: |-
BRANCH=github-action-single-page-doc-generator
git checkout -b $BRANCH
git config user.name GitHub Actions
git config user.email [email protected]
git config --global http.postBuffer 524288000
git add single-page/*.html
git checkout .
git gc
git fsck
git commit -m "Code generated by SinglePageDocGenerator.py"
git push --set-upstream origin $BRANCH -f