Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action for pushing backend dockerfile to artifact registry #92

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Backend Dockerfile to Artifact Regitry

on:
push:
branches:
- 'main'

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: code checkout
uses: actions/checkout@v4

- name: install gcloud cli
uses: google-github-actions/setup-gcloud@v0
with:
project_id: automateml
service_account_key: ${{secrets.GCP_SA_KEY}}
export_default_credentials: true

- name: build and push docker image
env:
GOOGLE_PROJECT: automateml
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/automateml/backend-docker-image/backend:latest ./backend
docker push us-central1-docker.pkg.dev/automateml/backend-docker-image/backend:latest