Skip to content

Commit

Permalink
Updated deploy gha
Browse files Browse the repository at this point in the history
  • Loading branch information
fileformat committed Oct 22, 2024
1 parent 6b159e5 commit b16ccb8
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/gcr-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: build
name: deploy

on:
push:
branches:
- main

workflow_dispatch:

# Environment variables available to all jobs and steps in this workflow
Expand All @@ -14,31 +15,35 @@ env:
RUN_SERVICE: ${{ secrets.RUN_SERVICE }}

jobs:
setup-build-deploy:
name: Setup, Build, and Deploy
deploy:
name: Deploy to CloudRun
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@master
- name: gcloud auth
id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
credentials_json: '${{ secrets.GCP_SA_KEY }}'

# Configure gcloud CLI
- name: gcloud Set up
run: |
gcloud config set project ${RUN_PROJECT}
# Setup gcloud CLI
- name: gcloud setup
uses: google-github-actions/setup-gcloud@v2

- name: gcloud docker-auth
run: gcloud auth configure-docker

# Build and push image to Google Container Registry
- name: Build
run: |
docker build \
--build-arg COMMIT=${GITHUB_SHA:0:7} \
--build-arg LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
--tag gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA .
--tag gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA \
.
- name: GCloud auth to docker
run: |
Expand Down

0 comments on commit b16ccb8

Please sign in to comment.