forked from HTTPArchive/almanac.httparchive.org
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 2.14 KB
/
generate_ebooks.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
60
61
62
63
64
65
66
67
######################################
## Custom Web Almanac GitHub action ##
######################################
#
# Generate the ebooks when this GitHub Action is run manually
# This should be run everytime before release
#
name: Generate Ebooks
env:
# Update periodically from https://www.princexml.com/latest/
PRINCE_PACKAGE: 'prince_20200728-1_ubuntu20.04_amd64.deb'
on:
workflow_dispatch:
jobs:
build:
name: Auto-generate Ebooks
# Prince needs ubuntu 20 and ubuntu-latest is only on 18
runs-on: ubuntu-20.04
steps:
- name: Checkout branch
uses: actions/[email protected]
- name: Setup Node.js for use with actions
uses: actions/[email protected]
with:
version: 12.x
- name: Set up Python 3.8
uses: actions/[email protected]
with:
python-version: '3.8'
- name: Install Asian Fonts
run: |
# Install Japanese san-serif font
sudo apt-get install -y fonts-ipafont-gothic
# Install Chinese san-serif font
sudo apt-get install -y fonts-arphic-uming
# Install Korean san-serif font
sudo apt-get install -y fonts-unfonts-core
- name: Install PrinceXML
run: |
wget https://www.princexml.com/download/${{ env.PRINCE_PACKAGE }} --directory-prefix=/tmp
DEBIAN_FRONTEND=noninteractive sudo apt install -y /tmp/${{ env.PRINCE_PACKAGE }}
- name: Install pdftk
run: sudo apt install pdftk
- name: Run the website
run: ./src/tools/scripts/run_and_test_website.sh
- name: Generating Ebooks
run: |
cd src
npm run ebooks
- name: Create Pull Request
id: cpr
uses: peter-evans/[email protected]
with:
title: Regenerate Ebooks
branch-suffix: timestamp
commit-message: Generate Ebooks
body: |
Regenerated Ebooks through GitHub action
- Auto-generated by [create-pull-request][1] GitHub Action
[1]: https://github.com/peter-evans/create-pull-request
labels: generate chapters
- name: Check outputs
run: echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"