-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (113 loc) Β· 3.85 KB
/
Copy pathdeploy.yml
File metadata and controls
119 lines (113 loc) Β· 3.85 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
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
name: CI/CD
on:
push:
branches: [main, prod]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm --prefix cms ci
- run: npm run cleanup-lovable
- run: npm run format
- run: npm run lint
- run: npm run cms:lint
- run: npm test
build:
needs: [test]
# run build only if previous jobs succeeded
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm --prefix cms ci
- run: npm run cleanup-lovable
- run: npm run format
- run: npm run lint
- run: npm run cms:lint
- run: npm run sitemap
- run: npm run build
- run: npm run cms:build
- name: Upload build artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: build
path: dist
# deploy-preview:
# needs: build
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'npm'
# - run: npm ci
# - run: npm run cleanup-lovable
# - name: Pull Vercel Environment
# run: npx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# - name: Build with Vercel
# run: npx vercel build --token=${{ secrets.VERCEL_TOKEN }}
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# - name: Deploy to Vercel
# id: deploy
# run: |
# npx vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > deployment-url.txt
# url=$(cat deployment-url.txt)
# echo "url=$url" >> $GITHUB_OUTPUT
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# - name: Comment preview URL
# uses: marocchino/sticky-pull-request-comment@v2
# with:
# message: |
# Vercel Preview URL: ${{ steps.deploy.outputs.url }}
# deploy-production:
# needs: build
# if: github.ref == 'refs/heads/prod' && github.event_name == 'push'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'npm'
# - run: npm ci
# - run: npm run cleanup-lovable
# - name: Pull Vercel Environment
# run: npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# - name: Build with Vercel (production)
# run: npx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# - name: Deploy to Vercel (production)
# run: npx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}