Skip to content

Commit df453b5

Browse files
committed
Add FE deploy
1 parent 379dde3 commit df453b5

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed
Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,64 @@
1-
name: Deploy to Vapor Production
1+
name: Deploy to Vapor and Frontend
22

33
on:
44
push:
55
branches:
6-
- master
7-
- feat/vapor
6+
- main
7+
- feat/front-end-deployment
88

99
jobs:
10-
vapor:
11-
name: Deploy to Vapor Production
10+
backend:
11+
name: Deploy Backend to Vapor
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
# Step 1: Checkout the repository
1615
- uses: actions/checkout@v2
1716

18-
# Step 2: Setup PHP
1917
- name: Setup PHP
2018
uses: shivammathur/setup-php@v2
2119
with:
2220
php-version: 8.3
2321
tools: composer:v2
2422
coverage: none
2523

26-
# Step 3: Prepare Laravel Environment
2724
- name: Prepare Laravel Environment
2825
working-directory: ./backend
2926
run: |
3027
mkdir -p bootstrap/cache
3128
chmod -R 775 bootstrap/cache
3229
33-
# Step 4: Prepare HTMLPurifier Cache Directory
3430
- name: Prepare HTMLPurifier Cache Directory
3531
working-directory: ./backend
3632
run: |
3733
mkdir -p storage/app/htmlpurifier
3834
chmod -R 775 storage/app/htmlpurifier
3935
40-
# Step 5: Install Dependencies
4136
- name: Install Dependencies
4237
working-directory: ./backend
4338
run: composer install --no-dev --no-progress --no-scripts --optimize-autoloader
4439

45-
# Step 6: Install Vapor CLI
4640
- name: Install Vapor CLI
4741
run: composer global require laravel/vapor-cli
4842

49-
# Step 7: Log the branch being deployed (Optional enhancement)
5043
- name: Log Branch
51-
run: echo "Deploying branch ${{ github.ref_name }}"
44+
run: echo "Deploying branch ${{ github.ref_name }} to Vapor"
5245

53-
# Step 8: Deploy to the Vapor Production Environment
54-
- name: Deploy to Production
46+
- name: Deploy to Vapor Production
5547
working-directory: ./backend
5648
run: vapor deploy production
5749
env:
5850
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
51+
52+
frontend:
53+
name: Deploy Frontend
54+
runs-on: ubuntu-latest
55+
needs: backend
56+
57+
steps:
58+
- uses: actions/checkout@v2
59+
60+
- name: Deploy to DigitalOcean App Platform
61+
run: |
62+
curl -X POST "https://api.digitalocean.com/v2/apps/${{ secrets.DIGITALOCEAN_PRODUCTION_APP_ID }}/deployments" \
63+
-H "Authorization: Bearer ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}" \
64+
-H "Content-Type: application/json"

backend/vapor.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,21 @@ environments:
1919
- 'php artisan optimize'
2020
deploy:
2121
- 'php artisan migrate --force'
22-
22+
staging:
23+
gateway-version: 2.0
24+
domain: staging.hi.events
25+
memory: 1024
26+
cli-memory: 512
27+
runtime: 'php-8.3:al2'
28+
warm: 3
29+
cache: hievents-redis-prod
30+
database: hievents-db-staging
31+
queue: hievents-queue-staging
32+
queue-memory: 1024
33+
queue-concurrency: 2
34+
concurrency: 100
35+
build:
36+
- 'composer install --no-dev'
37+
- 'php artisan optimize'
38+
deploy:
39+
- 'php artisan migrate --force'

0 commit comments

Comments
 (0)