-
Notifications
You must be signed in to change notification settings - Fork 17
61 lines (55 loc) · 1.37 KB
/
pages.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
name: Deploy to CloudFlare Pages
on:
repository_dispatch:
types: [deploy]
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/pages.yml'
- 'src/**.rs'
- 'build.rs'
- 'input.css'
- 'package.json'
- 'tailwind.config.js'
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2024-02-12
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: davidB/rust-cargo-make@v1
- name: Pre Build
run: |
npm i
- name: Build
env:
COLLABORATORS_API_TOKEN: ${{ secrets.COLLABORATORS_API_TOKEN }}
run: cargo make build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./artifact --project-name=homepage