Skip to content

Commit

Permalink
ci: add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiamoe committed Jul 9, 2024
1 parent 333c364 commit a7c05b4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish container

# These permissions are needed to assume roles from Github's OIDC.
permissions:
contents: read
id-token: write

on:
# TODO: Remove this. Publish on PR is only here for testing this workflow.
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
tags:
- 'v*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compute repo metadata
id: repo
run: |-
echo "name=$(basename '${{ github.repository }}')" >> $GITHUB_OUTPUT
echo "version=$(./scripts/version)" >> $GITHUB_OUTPUT
- name: Login to Google Artifact Registry
uses: grafana/shared-workflows/actions/login-to-gar@main
- name: Build container and push to GAR
uses: grafana/shared-workflows/actions/push-to-gar-docker@main
with:
image_name: ${{ steps.repo.outputs.name }}
tags: |-
${{ steps.repo.outputs.version }}
push: true

0 comments on commit a7c05b4

Please sign in to comment.