-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (58 loc) · 2.08 KB
/
Copy pathswarm-upload.yml
File metadata and controls
69 lines (58 loc) · 2.08 KB
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
# Same shape as devcon-swarm-exporter `.github/workflows/swarm-upload.yml`:
# manual or scheduled run, build the static mirror, upload to Swarm + feed update.
name: Upload mirror to Swarm
on:
workflow_dispatch:
concurrency:
group: swarm-upload-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 360
env:
# Optional repo variable: set MAX_PAGES in Settings → Variables to cap crawl size in CI.
MAX_PAGES: ${{ vars.MAX_PAGES }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright Chromium (system deps + browser)
run: npx playwright install chromium --with-deps
- name: Crawl devcon.org into ./mirror
run: npm run crawl
env:
RESUME: '0'
- name: Upload to Swarm
uses: ethersphere/swarm-actions/upload-dir@v1
id: upload
with:
dir: ./mirror
index-document: index.html
postage-batch-id: ${{ secrets.PRIVATE_POSTAGE_BATCH_ID }}
bee-url: ${{ secrets.PRIVATE_BEE_URL }}
- name: Setup feed
uses: ethersphere/swarm-actions/write-feed@v1
id: feed
with:
reference: ${{ steps.upload.outputs.reference }}
topic: devcon-export-mirror
postage-batch-id: ${{ secrets.PRIVATE_POSTAGE_BATCH_ID }}
bee-url: ${{ secrets.PRIVATE_BEE_URL }}
signer: ${{ secrets.PRIVATE_SIGNER }}
- uses: ethersphere/swarm-actions/reference-to-cid@v1
id: cid
with:
reference: ${{ steps.feed.outputs.manifest }}
- name: Summary
run: |
echo 'Chunk reference: ${{ steps.upload.outputs.reference }}'
echo 'Feed reference: ${{ steps.feed.outputs.reference }}'
echo 'Feed manifest: ${{ steps.feed.outputs.manifest }}'
echo "Feed bzz.link: https://${{ steps.cid.outputs.cid }}.bzz.link"