Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
chore: build to github registry
Browse files Browse the repository at this point in the history
Signed-off-by: Gustavo <[email protected]>
  • Loading branch information
gusinacio committed Jul 2, 2024
1 parent 201bc15 commit 48c703d
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
name: docker
on:
push:
branches:
- main
tags:
- '*'

env:
REGISTRY: ghcr.io/${{ github.repository_owner }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
packages: write
steps:
- id: auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v0
with:
token_format: access_token
workload_identity_provider: projects/661473808279/locations/global/workloadIdentityPools/github-actions/providers/gh-provider
service_account: [email protected]
access_token_lifetime: 600s
- name: Login to Artifact Registry
uses: docker/login-action@v1
- name: Log in to the Container registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get tag
id: get-tag
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
Expand All @@ -35,5 +31,5 @@ jobs:
TARGET=${{ matrix.contract }}
push: true
tags: |
us-central1-docker.pkg.dev/graphplots/elric-rs/app:latest
us-central1-docker.pkg.dev/graphplots/elric-rs/app:${{ steps.get-tag.outputs.short_ref }}
${{ env.REGISTRY }}/elric-rs/app:latest
${{ env.REGISTRY }}/elric-rs/app:${{ steps.get-tag.outputs.short_ref }}

0 comments on commit 48c703d

Please sign in to comment.