From 30837e9c2fd53dfb47a13c31033b46bf781274d4 Mon Sep 17 00:00:00 2001 From: Jay Bhavsar Date: Thu, 18 Apr 2024 20:49:20 +0530 Subject: [PATCH] single ci --- .github/workflows/cloud-run-deploy.yml | 30 -------------------------- .github/workflows/docker-build.yml | 25 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/cloud-run-deploy.yml diff --git a/.github/workflows/cloud-run-deploy.yml b/.github/workflows/cloud-run-deploy.yml deleted file mode 100644 index f74de49..0000000 --- a/.github/workflows/cloud-run-deploy.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Update Google Cloud Run Service - -on: - workflow_run: - workflows: ["Build and Push Docker Image"] - types: - - completed - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Authenticate with Google - uses: google-github-actions/auth@v0 - with: - credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - - - name: Deploy to cloud run - id: 'deploy' - uses: 'google-github-actions/deploy-cloudrun@v2' - with: - service: 'web3-testimonials' - image: 'jbhv12/web3-testimonials:latest' - - - name: 'Use output' - run: 'curl "${{ steps.deploy.outputs.url }}"' \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b39a3ac..5db9720 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,4 +1,4 @@ -name: Build and Push Docker Image +name: Build/Push Docker Image and update the service on: push: @@ -40,4 +40,25 @@ jobs: tags: ${{ secrets.DOCKERHUB_USERNAME }}/web3-testimonials:${{ env.TAG }} - name: Logout from DockerHub - run: docker logout \ No newline at end of file + run: docker logout + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Authenticate with Google + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + + - name: Deploy to cloud run + id: 'deploy' + uses: 'google-github-actions/deploy-cloudrun@v2' + with: + service: 'web3-testimonials' + image: 'jbhv12/web3-testimonials:latest' + + - name: 'Use output' + run: 'curl "${{ steps.deploy.outputs.url }}"' \ No newline at end of file