-
Notifications
You must be signed in to change notification settings - Fork 1
172 lines (151 loc) · 4.35 KB
/
reusable-archive-bundle.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: 'Reusable workflow: Archive bundle'
on:
workflow_call:
inputs:
bundle:
description: The slug of the bundle to archive
required: true
type: string
jobs:
sources:
name: Sources
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: get-site-list
uses: ./.github/actions/batch
with:
command: sites-by-bundle ${{ inputs.bundle }}
outputs:
site-list: ${{ steps.get-site-list.outputs.site-list }}
archive:
name: Archive
runs-on: ubuntu-latest
needs: sources
timeout-minutes: 60
continue-on-error: true
strategy:
fail-fast: false
matrix:
source: ${{ fromJson(needs.sources.outputs.site-list) }}
steps:
- id: checkout
name: Checkout
timeout-minutes: 5
uses: actions/checkout@v3
- id: install
timeout-minutes: 5
name: Install Python dependencies
uses: ./.github/actions/install
- id: mk-dist-dir
name: Create distribution directory
run: mkdir _dist
shell: bash
- id: screenshot-cropped
name: Screenshot (cropped)
timeout-minutes: 5
uses: ./.github/actions/screenshot-cropped
with:
source: ${{ matrix.source }}
- id: screenshot-full-page
name: Screenshot (full page)
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/screenshot-full-page
with:
source: ${{ matrix.source }}
- id: hyperlinks
name: Hyperlinks
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/hyperlinks
with:
source: ${{ matrix.source }}
- id: accessibility
name: Accessibility tree
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/accessibility
with:
source: ${{ matrix.source }}
- id: wayback
name: Wayback Machine
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/wayback
with:
source: ${{ matrix.source }}
access-key: ${{ secrets.IA_ACCESS_KEY }}
secret-key: ${{ secrets.IA_SECRET_KEY }}
- id: adstxt
name: ads.txt
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/adstxt
with:
source: ${{ matrix.source }}
- id: robotstxt
name: robots.txt
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/robotstxt
with:
source: ${{ matrix.source }}
- id: lighthouse
name: Lighthouse
if: ${{ always() }}
timeout-minutes: 10
uses: ./.github/actions/lighthouse
with:
source: ${{ matrix.source }}
- id: archive
name: Archive
if: ${{ always() }}
timeout-minutes: 10
uses: ./.github/actions/archive
with:
source: ${{ matrix.source }}
access-key: ${{ secrets.IA_ACCESS_KEY }}
secret-key: ${{ secrets.IA_SECRET_KEY }}
collection: ${{ secrets.IA_COLLECTION }}
- id: download-items
name: Download items
if: ${{ always() }}
timeout-minutes: 5
uses: ./.github/actions/download-items
with:
command: ${{ matrix.source }}
access-key: ${{ secrets.IA_ACCESS_KEY }}
secret-key: ${{ secrets.IA_SECRET_KEY }}
collection: ${{ secrets.IA_COLLECTION }}
post:
name: Post
runs-on: ubuntu-latest
timeout-minutes: 15
needs: archive
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: install
name: Install Python dependencies
uses: ./.github/actions/install
- uses: actions/download-artifact@v3
with:
name: screenshots
path: ./_input
- id: mosaic
name: Mosaic
uses: ./.github/actions/mosaic
with:
command: jpg -i ./_input/
- id: toot
name: Toot
uses: ./.github/actions/toot
with:
command: bundle ${{ inputs.bundle }} -i ./_dist
client-key: ${{ secrets.MASTODON_CLIENT_KEY }}
client-secret: ${{ secrets.MASTODON_CLIENT_SECRET }}
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}