Skip to content

Commit

Permalink
🔧 Add Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Irori235 committed Oct 19, 2023
1 parent b904f10 commit 17fe3c0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build docker image and push to Artifact Registry

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v1
with:
token_format: access_token
workload_identity_provider: "projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/${{ secrets.GOOGLE_WID_POOL_ID }}/providers/${{ secrets.GOOGLE_WID_PROVIDER_ID }}"
service_account: ${{ secrets.GOOGLE_SA_EMAIL }}
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Create Tag
id: create-tag
run: echo ::set-output name=tag::$(echo ${{ github.sha }} | cut -c1-7)
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
user/app:${{ steps.create-tag.outputs.tag }}
user/app:latest

1 comment on commit 17fe3c0

@vercel
Copy link

@vercel vercel bot commented on 17fe3c0 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.