Skip to content

Update deploy.yml

Update deploy.yml #25

Workflow file for this run

name: build and deploy to cloud run
permissions:
id-token: write
contents: read
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
# runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{secrets.DOCKER_USER}}/liatrioexercise
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Docker Push
run: docker push ${{secrets.DOCKER_USER}}/liatrioexercise
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
create_credentials_file: true
workload_identity_provider: 'https://iam.googleapis.com/projects/492409410562/locations/global/workloadIdentityPools/liatrio-pool/providers/liatrio-deploy-action'
service_account: '[email protected]'
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v0
with:
service: liatrio-interview-exercise
region: us-west1
image: docker.io/${{secrets.DOCKER_USER}}/liatrioexercise
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}