-
Notifications
You must be signed in to change notification settings - Fork 10
55 lines (45 loc) · 2.15 KB
/
docker.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: "Manually Deploy Docker Files to Artifact Registry"
on:
workflow_dispatch:
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@v1
with:
credentials_json: ${{ secrets.OWNER_SA_KEY }}
- name: Decode credentials.json
run: echo "${{ secrets.B64_ENCODED_KEY }}" | base64 --decode > ./backend/credentials.json
- name: Install GCloud CLI
uses: google-github-actions/setup-gcloud@v1
- name: List files in the backend directory
run: ls -l ./backend
- name: Build and Push Backend Docker Image
env:
GOOGLE_PROJECT: ${{ secrets.PROJECT_ID }}
CREDENTIALS_JSON: ${{ secrets.B64_ENCODED_KEY }}
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build --build-arg CREDENTIALS_JSON=./credentials.json -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