Repository navigation
66 lines (61 loc) · 2.08 KB
/
Copy pathdeploy-pages.yml
File metadata and controls
66 lines (61 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
name: Deploy app to Pages
# Builds the in-browser migration console (app/) and publishes it to GitHub
# Pages at https://filozone.github.io/ipfs2foc/. Enable once in repo Settings →
# Pages → Source: GitHub Actions.
on:
push:
branches: [main]
paths:
- 'app/**'
- 'packages/core/**'
- 'pnpm-workspace.yaml'
- 'pnpm-lock.yaml'
- '.github/workflows/deploy-pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
# Install the whole workspace so the app can reuse ipfs2foc-core
# (packages/core) with the exact multiformats / data-segment versions the
# commitments are computed over.
- run: pnpm install --frozen-lockfile
# A custom domain serves from the root; the PAGES_BASE repo variable
# flips the asset base at cutover with no commit (set it to /).
- run: pnpm --filter ipfs2foc-app build
env:
VITE_BASE: ${{ vars.PAGES_BASE || '/ipfs2foc/' }}
VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }}
VITE_METRICS_ENDPOINT: ${{ vars.METRICS_ENDPOINT }}
VITE_METRICS_TOKEN: ${{ vars.METRICS_TOKEN }}
# Launch invariants render the built app in the runner's Chrome and fail
# the deploy if the landing promises regressed. The repo variable can
# override EXPECTED_DEFAULT_NETWORK without a commit if it ever must.
- run: pnpm --filter ipfs2foc-app launch-invariants
env:
EXPECTED_DEFAULT_NETWORK: ${{ vars.EXPECTED_DEFAULT_NETWORK || 'mainnet' }}
- uses: actions/upload-pages-artifact@v3
with:
path: app/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4