ci: add publish workflow #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |