Use different auth method #2
Workflow file for this run
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: cd | |
on: | |
push: | |
branches: | |
- "main" | |
- "setup-cd" | |
jobs: | |
deploy-gridle: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: "actions/checkout@v4" | |
- id: "auth" | |
name: "Authenticate to Google Cloud" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}" | |
# # This example uses the docker login action | |
# - uses: "docker/login-action@v1" | |
# with: | |
# registry: "us-central1-docker.pkg.dev" # or REGION-docker.pkg.dev | |
# username: "oauth2accesstoken" | |
# password: "${{ steps.auth.outputs.access_token }}" | |
# This example runs "docker login" directly to Artifact Registry. | |
- run: |- | |
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://us-central1-docker.pkg.dev | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
file: ./gridle_game/Dockerfile | |
tags: us-central1-docker.pkg.dev/geography-games/gridle-repo/gridle:latest |