Merge pull request #25 from eojeel/dependabot/npm_and_yarn/express-4.… #34
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 Google App Engine | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Replace secrets in Googles App Engine Deployment File | |
uses: 73h/[email protected] | |
env: | |
APP_KEY: ${{ secrets.APP_KEY }} | |
with: | |
app_yaml_path: "app.yaml" | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
tools: composer:v2 | |
- name: Install Composer dependencies | |
run: composer install --no-interaction --prefer-dist --optimize-autoloader | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Generate key | |
run: php artisan key:generate | |
- name: Clear Caches | |
run: php artisan cache:clear && php artisan cache:clear | |
- name: Tests | |
run: ./vendor/bin/pest | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- id: 'deploy' | |
uses: 'google-github-actions/deploy-appengine@v1' | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
deliverables: app.yaml | |
# Example of using the output | |
- id: 'test' | |
run: 'curl "${{ steps.deploy.outputs.url }}"' |