stop pointing to main #9
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
# **what?** | |
# This workflow generates a docker image and pushes it to the GitHub Container Registry | |
# | |
# **why?** | |
# Docker images for dbt are used in a number of important places throughout the dbt ecosystem. | |
# This is how we keep those images up-to-date. | |
# | |
# **when?** | |
# This is triggered indirectly via a release pipeline | |
name: "Docker release" | |
run-name: "Docker release: `${{ inputs.package }}==${{ inputs.version }}`" | |
permissions: | |
packages: write | |
on: | |
workflow_call: | |
inputs: | |
package: | |
description: "The package to release" | |
type: string | |
default: ${{ github.event.repository.name }} | |
version_number: | |
description: "The version number to release (e.g. 1.0.0b1, without `latest` or `v`)" | |
type: string | |
required: true | |
dockerfile: | |
description: "The path to the docker file from the repo root" | |
type: string | |
default: "docker/Dockerfile" | |
platforms: | |
description: "The platforms to publish as a comma-delimited string" | |
type: string | |
default: "linux/amd64" | |
test_run: | |
description: "Test run (don't publish)" | |
type: boolean | |
default: true | |
jobs: | |
tags: | |
name: "Get container tags" | |
runs-on: ubuntu-latest | |
outputs: | |
tags: ${{ steps.tags.outputs.fully_qualified_tags }} | |
steps: | |
- name: "Get the tags to publish" | |
id: tags | |
# this cannot be relative because this workflow is called from multiple repos | |
uses: dbt-labs/dbt-release/.github/actions/latest-wrangler | |
with: | |
package_name: ${{ inputs.package }} | |
new_version: ${{ inputs.version_number }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
build-and-release: | |
name: "Set up Docker image builder, build and push" | |
runs-on: ubuntu-latest | |
needs: [tags] | |
steps: | |
- name: "[DEBUG] Log inputs" | |
shell: bash | |
run: | | |
echo Package: ${{ inputs.package }} | |
echo Version: ${{ inputs.version_number }} | |
echo Tags: ${{ needs.tags.outputs.tags }} | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@v3 | |
- name: "Log in to GHCR" | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Build `${{ inputs.package }}==${{ inputs.version_number }}`; push: ${{ !inputs.test_run }}" | |
uses: docker/build-push-action@v5 | |
with: | |
file: ${{ inputs.dockerfile }} | |
push: ${{ !inputs.test_run }} | |
platforms: ${{ inputs.platforms }} | |
target: ${{ inputs.package }} | |
build-args: commit_ref=v${{ inputs.version_number }} | |
tags: ${{ needs.tags.outputs.tags }} |