Update main.yml #2
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 Cloud Run" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@main | |
with: | |
project_id: seznamka-422904 | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
export_default_credentials: true | |
- name: Configure docker for GCP | |
run: gcloud auth configure-docker | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: gcr.io/seznamka-422904/CI-CD-test/phpwebserver:latest | |
- name: Deploy to Cloud Run | |
uses: google-github-actions/deploy-cloudrun@main | |
with: | |
image: gcr.io/seznamka-422904/CI-CD-test/phpwebserver:latest | |
service: phpwebserver | |
region: europe-west2 | |
platform: managed | |
allow-unauthenticated: true | |
env_vars: | | |
FOO=bar | |
ZIP=zap |