|
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 |
| 1 | +name: Deploy to Vapor Production |
21 | 2 |
|
| 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