-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (65 loc) · 1.63 KB
/
deploy.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
62
63
64
65
66
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- "**.json"
- "**.js"
- "**.jsx"
- "**.mjs"
- "**.ts"
- "**.tsx"
- "**.astro"
- "**.lockb"
- "!**.test.ts"
- "!**.d.ts"
push:
branches:
- main
paths:
- "**.json"
- "**.js"
- "**.jsx"
- "**.mjs"
- "**.ts"
- "**.tsx"
- "**.astro"
- "**.lockb"
- "!**.test.ts"
- "!**.d.ts"
jobs:
deploy:
permissions:
pull-requests: "write"
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
name: setup bun
with:
bun-version: 1.0.22
- name: install dependencies
run: bun install
- name: pull latest data
run: bun run data
- name: build site
run: bun run build
- name: deploy
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=genocide-club site/dist
- uses: actions/github-script@v6
if: ${{ github.ref != 'refs/heads/main' }}
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Preview build deployed to: ${process.env.DEPLOYMENT_URL}`
})