-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (85 loc) · 2.54 KB
/
ci-cd.yml
File metadata and controls
108 lines (85 loc) · 2.54 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
name: Testing & Deploy Application
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
DB_CONNECTION: pgsql
DB_HOST: localhost
DB_PORT: 5432
DB_DATABASE: testing
DB_USERNAME: postgres
DB_PASSWORD: postgres
on:
push:
branches:
- main
paths-ignore:
- ".env.example"
- ".prettierrc"
- "README.md"
jobs:
Testing-Application:
name: Testing Application
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: testing
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 3
ports:
- 5432:5432
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
tools: composer:v2
coverage: xdebug
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"
- name: Install Node Dependencies
run: bun install --frozen-lockfile
- name: Install Playwright
run: bunx playwright install
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Copy Environment File
run: cp .env.example .env
- name: Clear Config
run: php artisan config:clear
- name: Generate Application Key
run: php artisan key:generate
- name: Run Database Migration
run: php artisan migrate -v
- name: Building Assets
run: bun run build
- name: Test with Pest
run: php artisan test --ci --parallel
Deploy-Application:
needs: Testing-Application
name: Deploy Application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"
- name: Install Vercel CLI
run: bun add -g vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ env.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ env.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ env.VERCEL_TOKEN }}