From 0841a8f9fad06a3b7d38351b1437cc9cd3927c48 Mon Sep 17 00:00:00 2001 From: Pratap2018 Date: Mon, 4 Dec 2023 14:11:05 +0530 Subject: [PATCH] updated action --- .github/workflows/image-publish.yaml | 29 ++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/image-publish.yaml b/.github/workflows/image-publish.yaml index 0804aa6..2799dbd 100644 --- a/.github/workflows/image-publish.yaml +++ b/.github/workflows/image-publish.yaml @@ -6,11 +6,16 @@ on: - "master" jobs: - deploy: + build-push-artifact: runs-on: ubuntu-latest steps: - name: code checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + + - id: "auth" + uses: "google-github-actions/auth@v1" + with: + credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" - name: install gcloud cli tools uses: google-github-actions/setup-gcloud@v1 @@ -18,16 +23,24 @@ jobs: project_id: ${{secrets.GOOGLE_PROJECT_ID}} service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} export_default_credentials: true + - name: "Use gcloud CLI" + run: "gcloud info" + - - name: build and push the docker image - env: - GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} + - name: "Docker Auth" run: gcloud auth configure-docker asia-south1-docker.pkg.dev - docker build -t asia-south1-docker.pkg.dev/$GOOGLE_PROJECT_ID/hypersign-image-repository/hypersign-vault-service:latest . - - docker push asia-south1-docker.pkg.dev/$GOOGLE_PROJECT_ID/hypersign-image-repository/hypersign-vault-service:latest + - name: "Docker Build" + env: + GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} + run: + docker build -t asia-south1-docker.pkg.dev/$GOOGLE_PROJECT_ID/hypersign-image-repository/ + - name: Push image + env: + GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} + run: + docker push asia-south1-docker.pkg.dev/$GOOGLE_PROJECT_ID/hypersign-image-repository/