Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create gcp-artifact-registry.yml #7

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/gcp-artifact-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release
on:
push:

jobs:
docker-release:
name: Tagged Docker release to Google Artifact Registry
runs-on: ubuntu-latest

permissions:
contents: 'read'
id-token: 'write'

steps:
- id: checkout
name: Checkout
uses: actions/checkout@v2

- id: auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v0
with:
token_format: access_token
workload_identity_provider: projects/363816104163/locations/global/workloadIdentityPools/pv-labs-pool/providers/pv-labs-workload-provider
service_account: [email protected]
access_token_lifetime: 300s

- name: Login to Artifact Registry
uses: docker/login-action@v1
with:
registry: us-east1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

- name: Get tag
id: get-tag
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}

- id: docker-push-tagged
name: Tag Docker image and push to Google Artifact Registry
uses: docker/build-push-action@v2
with:
push: true
tags: |
us-east1-docker.pkg.dev/pv-labs/weather-app/weather-app:v1
Loading