-
Notifications
You must be signed in to change notification settings - Fork 138
59 lines (49 loc) · 1.97 KB
/
html_generation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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