-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.12 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
name: Deploy
on:
pull_request:
branches:
- main
paths:
- src/**
push:
branches:
- main
paths:
- src/**
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name == 'main' && 'Production' || 'Preview' }}
url: ${{ steps.deployment_url.outputs.DEPLOYMENT_URL }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: install deps
run: rm -rf node_modules && bun install --ignore-scripts --frozen-lockfile
- name: build
run: bun run build
- name: deploy
id: cloudflare-wrangler
uses: cloudflare/wrangler-action@v3
with:
packageManager: bun
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./build --project-name=tawri --branch ${{ github.ref_name == 'main' && 'main' || 'preview' }}
- name: Get deployment url
id: deployment_url
run: echo "DEPLOYMENT_URL=${{ steps.cloudflare-wrangler.outputs.deployment-url }}" >> $GITHUB_ENV