Update action #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Vapor Production | |
on: | |
push: | |
branches: | |
- master | |
- feat/vapor | |
jobs: | |
vapor: | |
name: Deploy to Vapor Production | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- uses: actions/checkout@v2 | |
# Step 2: Setup PHP | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
tools: composer:v2 | |
coverage: none | |
# Step 3: Navigate to the backend and prepare environment | |
- name: Prepare Laravel Environment | |
working-directory: ./backend | |
run: | | |
mkdir -p bootstrap/cache | |
chmod -R 775 bootstrap/cache | |
# Step 4: Install Dependencies | |
- name: Install Dependencies | |
working-directory: ./backend | |
run: composer install --no-dev --no-progress --no-scripts --optimize-autoloader | |
# Step 5: Install Vapor CLI | |
- name: Install Vapor CLI | |
run: composer global require laravel/vapor-cli | |
# Step 6: Log the branch being deployed (Optional enhancement) | |
- name: Log Branch | |
run: echo "Deploying branch ${{ github.ref_name }}" | |
# Step 7: Deploy to the Vapor Production Environment | |
- name: Deploy to Production | |
working-directory: ./backend | |
run: vapor deploy production | |
env: | |
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }} |