From 31e73843ca57e20eaf1e0221e047a12503fcbe22 Mon Sep 17 00:00:00 2001 From: rawanmahdi Date: Wed, 1 Nov 2023 19:56:35 -0400 Subject: [PATCH 1/2] Add action for pushing backend dockerfile to artifact registry --- .github/workflows/build.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..a8437ef --- /dev/null +++ b/.github/workflows/build.yaml @@ -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 ./backend From 4fca0149ac09744017747147384865de3a98687f Mon Sep 17 00:00:00 2001 From: rawanmahdi Date: Thu, 2 Nov 2023 08:30:51 -0400 Subject: [PATCH 2/2] Remove extra arg --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a8437ef..51cb629 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,4 +25,4 @@ jobs: 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 ./backend + docker push us-central1-docker.pkg.dev/automateml/backend-docker-image/backend:latest