-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (69 loc) · 2.23 KB
/
genpdf.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Start the docs server
run: |
npx live-server docs &
sleep 20
- name: Install dependencies
run: |
npm install puppeteer
- name: Install gowitness
run: |
sudo apt-get update
sudo apt-get install -y libnss3-tools wget
wget https://github.com/sensepost/gowitness/releases/download/2.5.1/gowitness-2.5.1-linux-amd64
mv gowitness-2.5.1-linux-amd64 gowitness
chmod +x gowitness
./gowitness
# - name: Generate URLs
# run: |
# node -e "
# const puppeteer = require('puppeteer');
# (async () => {
# const browser = await puppeteer.launch();
# const page = await browser.newPage();
# await page.goto('http://localhost:8080');
# const numberOfPages = await page.evaluate(() => {
# return document.querySelectorAll('.remark-slide').length;
# });
# const urls = Array.from({ length: numberOfPages }, (_, i) => \`http://localhost:8080/#\${i + 1}\`).join('\\n');
# require('fs').writeFileSync('urls.txt', urls);
# await browser.close();
# })();"
- name: Print Urls
run: |
cat urls.txt
- name: Run gowitness on URLs
run: |
./gowitness file -f urls.txt
- name: Install imagemagick
run: |
sudo apt-get install -y imagemagick
- name: Convert images to PDF
run: |
convert screenshots/*.png screenshots/output.pdf
echo "PDF created: screenshots/output.pdf"
- name: Upload PDF artifact
uses: actions/upload-artifact@v3
with:
name: slides-pdf
path: screenshots/output.pdf
- name: Print Actions run URL
run: |
echo "Download the artifact from: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"