-
Notifications
You must be signed in to change notification settings - Fork 7
120 lines (100 loc) · 3.21 KB
/
cd.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CD
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_DEFAULT_ACCOUNT_ID: f02b3ef168fe64129e9941b4fb2e4dc1
jobs:
landing:
name: Landing
runs-on: ubuntu-latest
environment:
name: landing
url: ${{ steps.result.outputs.DEPLOYMENT_URL }}
env:
VITE_MATTRAX_CLOUD_ORIGIN: https://web.mattrax.app
steps:
- name: Git clone the repository
uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# with:
# version: latest
# - name: Install dependencies
# run: pnpm i
# - name: Build
# working-directory: apps/landing
# env:
# NITRO_PRESET: cloudflare_pages
# run: pnpm build
# - name: Deploy
# working-directory: apps/landing
# run: |
# set -o pipefail
# pnpm dlx wrangler pages deploy dist/ --project-name landing 2>&1 | tee -a BUILD_OUTPUT
# - name: Export `DEPLOYMENT_URL`
# working-directory: apps/landing
# id: result
# run: echo "DEPLOYMENT_URL=$(grep -Eo 'https://[^ >]+' BUILD_OUTPUT|head -1)" >> $GITHUB_OUTPUT
# web:
# name: Web
# runs-on: ubuntu-latest
# environment:
# name: web
# url: ${{ steps.result.outputs.DEPLOYMENT_URL }}
# steps:
# - name: Git clone the repository
# uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# with:
# version: latest
# - name: Install dependencies
# run: pnpm i
# - name: Build
# working-directory: apps/web
# env:
# NITRO_PRESET: cloudflare_pages
# run: pnpm build
# - name: Deploy
# working-directory: apps/web
# run: |
# set -o pipefail
# pnpm dlx wrangler pages deploy dist/ --project-name web 2>&1 | tee -a BUILD_OUTPUT
# - name: Export `DEPLOYMENT_URL`
# working-directory: apps/web
# id: result
# run: echo "DEPLOYMENT_URL=$(grep -Eo 'https://[^ >]+' BUILD_OUTPUT|head -1)" >> $GITHUB_OUTPUT
# api:
# name: API
# runs-on: ubuntu-latest
# environment:
# name: api
# url: ${{ steps.result.outputs.DEPLOYMENT_URL }}
# steps:
# - name: Git clone the repository
# uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# with:
# version: latest
# - name: Install dependencies
# run: pnpm i
# - name: Build
# working-directory: apps/api
# env:
# NITRO_PRESET: cloudflare_pages
# run: pnpm build
# - name: Deploy
# working-directory: apps/api
# run: |
# set -o pipefail
# pnpm dlx wrangler deploy src/index.ts --define "import.meta.env.GIT_SHA:'$(git rev-parse HEAD)'" 2>&1 | tee -a BUILD_OUTPUT
# - name: Export `DEPLOYMENT_URL`
# working-directory: apps/api
# id: result
# run: echo "DEPLOYMENT_URL=$(grep -Eo 'https://[^ >]+' BUILD_OUTPUT|head -1)" >> $GITHUB_OUTPUT