Skip to content

Manually Deploy Docker Files to Artifact Registry #15

Manually Deploy Docker Files to Artifact Registry

Manually Deploy Docker Files to Artifact Registry #15

Workflow file for this run

name: "Manually Deploy Docker Files to Artifact Registry"
on:
workflow_dispatch:
# push:
# branches:
# - 'main'
# paths:
# -'backend/'
# -'frontend/'
# -'machine-learning/Dockerfile'
jobs:
deploy:
env:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
SA_KEY: ${{ secrets.OWNER_SA_KEY }}
runs-on: ubuntu-20.04
steps:
- name: Code Checkout
uses: actions/checkout@v4
- id: 'auth'
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.OWNER_SA_KEY }}
- name: Install GCloud CLI
uses: google-github-actions/setup-gcloud@v0
- name: Build and Push Backend Docker Image
env:
GOOGLE_PROJECT: ${{ secrets.PROJECT_ID }}
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/automate-gdsc/backend-images/backend:latest ./backend
docker push us-central1-docker.pkg.dev/automate-gdsc/backend-images/backend:latest
- name: Build and Push Frontend Docker Image
env:
GOOGLE_PROJECT: ${{ secrets.PROJECT_ID }}
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/automate-gdsc/frontend-images/frontend:latest ./frontend
docker push us-central1-docker.pkg.dev/automate-gdsc/frontend-images/frontend:latest
# - name: Build and Push ML Docker Image
# env:
# GOOGLE_PROJECT: ${{ secrets.PROJECT_ID }}
# run: |
# gcloud auth configure-docker us-central1-docker.pkg.dev
# docker build -t us-central1-docker.pkg.dev/automateml/ml-docker-image/ml:latest ./machine-learning
# docker push us-central1-docker.pkg.dev/automateml/ml-docker-image/ml:latest