Merge pull request #12 from ronykris/updateOttpapi #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ "deployed" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v4 | |
- id: auth | |
name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
service_account: '[email protected]' | |
workload_identity_provider: 'projects/686267651726/locations/global/workloadIdentityPools/github-actions-cloud-run-pool/providers/github' | |
- name: Configure Docker Hub | |
run: |- | |
gcloud auth configure-docker asia-south1-docker.pkg.dev | |
gcloud auth login | |
- name: Build the Docker image | |
run: |- | |
cd ottpApi | |
docker build -t ottpapi . | |
docker tag ottpapi:latest asia-south1-docker.pkg.dev/ecomscraper/images/ottpapi:latest | |
docker push asia-south1-docker.pkg.dev/ecomscraper/images/ottpapi:latest | |
gcloud run deploy \ | |
--image=asia-south1-docker.pkg.dev/ecomscraper/images/ottpapi:latest \ | |
--platform=managed \ | |
--region=asia-south1 \ | |
--allow-unauthenticated |