Deploy dev image to GAR (Google Artifact Registry) #12
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
# Reference: https://gist.github.com/joeyslalom/3a3b4783ea9f2e7fa3493c13bcf68e0a | |
name: Deploy dev image to GAR (Google Artifact Registry) | |
on: | |
workflow_dispatch: | |
env: | |
PROJECT_ID: easyml-394818 | |
GAR_LOCATION: us-central1 | |
jobs: | |
push-store: | |
name: Push the image to GAR | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@main | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v0.6.0' | |
with: | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
token_format: 'access_token' | |
- uses: 'docker/login-action@v1' | |
name: 'Docker login' | |
with: | |
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' | |
username: 'oauth2accesstoken' | |
password: '${{ steps.auth.outputs.access_token }}' | |
- name: 'Build Inventory Image' | |
working-directory: . | |
run: | | |
docker build --build-arg GITHUB_TOKEN=${{secrets.GHCR_PAT}} --build-arg BRANCH=dev . --tag $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/datadreamer:dev | |
docker push $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/datadreamer --all-tags |