-
Notifications
You must be signed in to change notification settings - Fork 344
38 lines (35 loc) · 1.08 KB
/
build-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Build & Push New Model
on:
push:
branches:
- "ci/new-model-deploy"
env:
PROJECT_ID: boostcamp-ai-tech-serving # TODO: replace this with your project
GAR_REGION: ap-norhteast3
REPOSITORY: model_deploy
IMAGE: main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Docker build'
run: |-
docker build \
--tag "$GAR_REGION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA" \
.
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/[email protected]'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
token_format: 'access_token'
- uses: 'docker/login-action@v1'
name: 'Docker login'
with:
registry: '${{ env.GAR_REGION }}-docker.pkg.dev'
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
- name: 'Docker push'
run: |-
docker push "$GAR_REGION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA"