Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Inacio authored and Gustavo Inacio committed Aug 11, 2023
1 parent c91f64d commit 4567530
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: docker
on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: '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: artifact-uploader@graphplots.iam.gserviceaccount.com
access_token_lifetime: 300s
- name: Login to Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-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/*/}
- name: Build and push
uses: docker/build-push-action@v4
with:
build-args: |
TARGET=${{ matrix.contract }}
push: true
tags: |
us-central1-docker.pkg.dev/graphplots/elric-rs:latest
us-central1-docker.pkg.dev/graphplots/elric-rs:${{ steps.get-tag.outputs.short_ref }}

0 comments on commit 4567530

Please sign in to comment.