Fix missing .env file #43
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: Build and Deploy to Cloud Run | |
on: | |
push: | |
branches: | |
- master | |
env: | |
PROJECT_ID: the-drawing | |
GAR_LOCATION: europe-west3 | |
REPOSITORY: hurlurl | |
SERVICE: hurlurl | |
REGION: europe-west1 | |
jobs: | |
deploy: | |
# Add 'id-token' with the intended permissions for workload identity federation | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Google Auth | |
id: auth | |
uses: 'google-github-actions/auth@v0' | |
with: | |
token_format: 'access_token' | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
# BEGIN - Docker auth and build (NOTE: If you already have a container image, these Docker steps can be omitted) | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Authenticate Docker to Google Cloud Artifact Registry | |
- name: Docker Auth | |
id: docker-auth | |
uses: 'docker/login-action@v1' | |
with: | |
username: 'oauth2accesstoken' | |
password: '${{ steps.auth.outputs.access_token }}' | |
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# END - Docker auth and build | |
- name: Deploy to Cloud Run | |
id: deploy | |
uses: google-github-actions/deploy-cloudrun@v0 | |
with: | |
service: ${{ env.SERVICE }} | |
region: ${{ env.REGION }} | |
# NOTE: If using a pre-built image, update the image name here | |
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} | |
# If required, use the Cloud Run url output in later steps | |
- name: Show Output | |
run: echo ${{ steps.deploy.outputs.url }} |