Skip to content

Commit 3252f15

Browse files
committed
Update action
1 parent 732bde0 commit 3252f15

File tree

2 files changed

+32
-62
lines changed

2 files changed

+32
-62
lines changed

.github/workflows/deploy-production.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,34 @@ jobs:
2323
tools: composer:v2
2424
coverage: none
2525

26-
# Step 3: Navigate to the backend and prepare environment
26+
# Step 3: Prepare Laravel Environment
2727
- name: Prepare Laravel Environment
2828
working-directory: ./backend
2929
run: |
3030
mkdir -p bootstrap/cache
3131
chmod -R 775 bootstrap/cache
3232
33-
# Step 4: Install Dependencies
33+
# Step 4: Prepare HTMLPurifier Cache Directory
34+
- name: Prepare HTMLPurifier Cache Directory
35+
working-directory: ./backend
36+
run: |
37+
mkdir -p storage/app/htmlpurifier
38+
chmod -R 775 storage/app/htmlpurifier
39+
40+
# Step 5: Install Dependencies
3441
- name: Install Dependencies
3542
working-directory: ./backend
3643
run: composer install --no-dev --no-progress --no-scripts --optimize-autoloader
3744

38-
# Step 5: Install Vapor CLI
45+
# Step 6: Install Vapor CLI
3946
- name: Install Vapor CLI
4047
run: composer global require laravel/vapor-cli
4148

42-
# Step 6: Log the branch being deployed (Optional enhancement)
49+
# Step 7: Log the branch being deployed (Optional enhancement)
4350
- name: Log Branch
4451
run: echo "Deploying branch ${{ github.ref_name }}"
4552

46-
# Step 7: Deploy to the Vapor Production Environment
53+
# Step 8: Deploy to the Vapor Production Environment
4754
- name: Deploy to Production
4855
working-directory: ./backend
4956
run: vapor deploy production

backend/vapor.yml

Lines changed: 20 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,21 @@
1-
name: Deploy to Vapor Production
1+
id: 68983
2+
name: HiEvents
3+
environments:
4+
production:
5+
memory: 1024
6+
cli-memory: 512
7+
runtime: 'php-8.3:al2'
8+
warm: 10
9+
cache: hievents-redis-prod
10+
database: hievents-db-prod
11+
queue: hievents-queue-prod
12+
queue-memory: 1024
13+
queue-concurrency: 5
14+
build:
15+
- 'composer install --no-dev'
16+
- 'php artisan optimize'
17+
deploy:
18+
- 'php artisan migrate --force'
19+
domains:
20+
- app.hi.events
221

3-
on:
4-
push:
5-
branches:
6-
- master
7-
- feat/vapor
8-
9-
jobs:
10-
vapor:
11-
name: Deploy to Vapor Production
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
# Step 1: Checkout the repository
16-
- uses: actions/checkout@v2
17-
18-
# Step 2: Setup PHP
19-
- name: Setup PHP
20-
uses: shivammathur/setup-php@v2
21-
with:
22-
php-version: 8.3
23-
tools: composer:v2
24-
coverage: none
25-
26-
# Step 3: Prepare Laravel Environment
27-
- name: Prepare Laravel Environment
28-
working-directory: ./backend
29-
run: |
30-
mkdir -p bootstrap/cache
31-
chmod -R 775 bootstrap/cache
32-
33-
# Step 4: Prepare HTMLPurifier Cache Directory
34-
- name: Prepare HTMLPurifier Cache Directory
35-
working-directory: ./backend
36-
run: |
37-
mkdir -p storage/app/htmlpurifier
38-
chmod -R 775 storage/app/htmlpurifier
39-
40-
# Step 5: Install Dependencies
41-
- name: Install Dependencies
42-
working-directory: ./backend
43-
run: composer install --no-dev --no-progress --no-scripts --optimize-autoloader
44-
45-
# Step 6: Install Vapor CLI
46-
- name: Install Vapor CLI
47-
run: composer global require laravel/vapor-cli
48-
49-
# Step 7: Log the branch being deployed (Optional enhancement)
50-
- name: Log Branch
51-
run: echo "Deploying branch ${{ github.ref_name }}"
52-
53-
# Step 8: Deploy to the Vapor Production Environment
54-
- name: Deploy to Production
55-
working-directory: ./backend
56-
run: vapor deploy production
57-
env:
58-
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}

0 commit comments

Comments
 (0)