-
Notifications
You must be signed in to change notification settings - Fork 145
120 lines (111 loc) · 3.15 KB
/
web.yml
File metadata and controls
120 lines (111 loc) · 3.15 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
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
---
name: Vortex Web
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
push:
branches: [develop]
permissions:
contents: read
defaults:
run:
working-directory: vortex-web
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pull-requests: read
outputs:
web: ${{ steps.filter.outputs.web }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
web:
- "vortex-web/**"
- ".github/workflows/web.yml"
check:
name: Check & Lint
needs: [changes]
if: needs.changes.outputs.web == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
enable-sccache: "false"
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
working-directory: .
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: "npm"
cache-dependency-path: vortex-web/package-lock.json
- run: npm ci
- env:
RUSTFLAGS: --cfg getrandom_backend="unsupported"
run: npm run wasm
- run: npm run format:check
- run: npm run lint
- run: npm run typecheck
- run: npm run build-storybook
build:
name: Build
needs: [changes]
if: needs.changes.outputs.web == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
enable-sccache: "false"
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
working-directory: .
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: "npm"
cache-dependency-path: vortex-web/package-lock.json
- run: npm ci
- env:
RUSTFLAGS: --cfg getrandom_backend="unsupported"
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: vortex-explorer
path: vortex-web/dist/
deploy:
name: Deploy to Cloudflare Pages
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
deployments: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- uses: actions/download-artifact@v8
with:
name: vortex-explorer
path: dist
- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist/ --project-name=vortex-explorer --branch=${{ github.head_ref || github.ref_name }}