-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.02 KB
/
deploy.yml
File metadata and controls
43 lines (35 loc) · 1.02 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
name: Deploy to Cloudflare Pages
on:
push:
branches: [master, dev]
pull_request:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Build (production)
if: github.ref == 'refs/heads/master'
run: npm run build
env:
VITE_API_BASE: https://api.bedbase.org/v1
- name: Build (dev)
if: github.ref != 'refs/heads/master'
run: npm run build
env:
VITE_API_BASE: https://api-dev.bedbase.org/v1
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=bedbase-ui --branch=${{ github.ref_name }}