Single-HTML-Page Documentation Generation #345
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: 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 | |
sudo apt-get install -y libmagickwand-dev wkhtmltopdf | |
- 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 |