Skip to content

Update main.yml

Update main.yml #2

Workflow file for this run

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