Skip to content

Commit

Permalink
Merge pull request #7 from tryolabs/hotfix/change-in-auth-cd
Browse files Browse the repository at this point in the history
Fix in auth
  • Loading branch information
FlorenciaOjeda authored Jun 27, 2024
2 parents 3fd0eb0 + 84004be commit fc3831a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Continuous Delivery'

on:
push:
pull_request: #TODO: For testing
branches:
- "main"

Expand All @@ -14,21 +14,20 @@ jobs:
uses: actions/checkout@v3

# Authenticate to Google Cloud
- name: Authenticate to Google Cloud
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
run: |
echo "$GOOGLE_CREDENTIALS" > /tmp/google-credentials.json
gcloud auth activate-service-account --key-file=/tmp/google-credentials.json
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

# Build and push Docker image
- name: Build and push Docker image
env:
CONTAINER_IMAGE_URL: ${{ secrets.CONTAINER_IMAGE_URL }}
GCLOUD_REGION: ${{ secrets.GCLOUD_REGION }}
run: |
docker build -t $CONTAINER_IMAGE_URL:latest .
gcloud auth configure-docker $GCLOUD_REGION
docker build -t $CONTAINER_IMAGE_URL:latest .
docker push $CONTAINER_IMAGE_URL:latest
deploy:
Expand Down

0 comments on commit fc3831a

Please sign in to comment.