Skip to content

ci: add publish workflow #5

ci: add publish workflow

ci: add publish workflow #5

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