Automate Amplify deployments

This commit is contained in:
Julien Nahum 2024-01-16 18:35:11 +01:00
parent 07dbc3adf3
commit f0750f22ee
1 changed files with 6 additions and 9 deletions

View File

@ -161,7 +161,7 @@ jobs:
matrix: matrix:
php: [ 8.2 ] php: [ 8.2 ]
name: Triggers deploy through Laravel Vapor name: Triggers Deployment (Vapor & Amplify)
steps: steps:
- name: Checkout code - name: Checkout code
@ -203,15 +203,12 @@ jobs:
- name: Directory permissions - name: Directory permissions
run: chmod -R 777 storage bootstrap/cache run: chmod -R 777 storage bootstrap/cache
- name: Install npm dependencies - name: Trigger front-end deployment
run: npm install --no-audit --no-progress --silent run: |
URL="${{ secrets.AMPLIFY_DEPLOY_URL }}"
curl -X POST -d {} "$URL" -H "Content-Type: application/json"
- name: Build client - name: Deploy back-end to production
run: npm run build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Deploy to production
run: php vendor/bin/vapor deploy api-production --commit="${GITHUB_SHA}" --message="${GITHUB_REF}" run: php vendor/bin/vapor deploy api-production --commit="${GITHUB_SHA}" --message="${GITHUB_REF}"
env: env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }} VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}