-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (42 loc) · 1.56 KB
/
Copy pathdeploy-site.yml
File metadata and controls
52 lines (42 loc) · 1.56 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
name: deploy-site
on:
push:
branches: [dev]
paths:
- "site/**"
# Build-check the site on PRs that touch it; deploy step is skipped (see below)
pull_request:
paths:
- "site/**"
# Allow manual trigger for first deploy or re-deploy without code change
workflow_dispatch:
concurrency:
group: deploy-site-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"
- run: bun install --frozen-lockfile
working-directory: site
- run: bun run build
working-directory: site
# Deploy only when on dev (push to dev or manual dispatch from dev). PRs and
# manual runs from other branches stop after the build-check steps above, so
# the fixed --branch=dev below can never publish non-dev content.
- uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3
if: github.ref == 'refs/heads/dev'
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site/dist --project-name=pawwork --branch=dev