Skip to content

Add Docker release workflow #934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: actions/github-releases
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/_publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "# Docker release"
run-name: "Docker release - ${{ github.actor }} - package:${{ inputs.package }} deploy-to:${{ inputs.deploy-to }} branch:${{ inputs.branch }}"

permissions:
packages: write

on:
workflow_call:
inputs:
package:
description: "Choose the package to publish"
type: string
required: true
deploy-to:
description: "Choose whether to publish to test or prod"
type: string
default: "prod"
version:
description: "Choose the version to publish"
type: string
required: true
workflow_dispatch:
inputs:
package:
description: "Choose the package to publish"
type: choice
options:
- "dbt-athena"
- "dbt-bigquery"
- "dbt-postgres"
- "dbt-redshift"
- "dbt-snowflake"
- "dbt-spark"
deploy-to:
description: "Choose whether to publish to test or prod"
type: environment
default: "test"
version:
description: "Choose the version to publish"
type: string
required: true

jobs:
publish:
runs-on: ${{ vars.DEFAULT_RUNNER }}
steps:
- id: tags
uses: dbt-labs/dbt-release/.github/actions/latest-wrangler@main
with:
package_name: ${{ inputs.package }}
new_version: ${{ inputs.version_number }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: 'ghcr.io'
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
push: ${{ inputs.deploy-to == 'prod' }}
target: ${{ inputs.package }}
file: ./Dockerfile
platforms: 'linux/amd64'
tags: ${{ steps.tags.outputs.tags }}
build-args: version=v${{ inputs.version }} py_version=${{ vars.DOCKER_PYTHON_VERSION }}
2 changes: 1 addition & 1 deletion .github/workflows/_publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ env:

jobs:
publish:
runs-on: ubuntu-latest
runs-on: ${{ vars.DEFAULT_RUNNER }}
defaults:
run:
working-directory: ./${{ inputs.package }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/publish-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
options:
- "pypi"
- "github"
- "docker"
- "all"
skip-unit-tests:
description: "Skip running unit tests"
Expand Down Expand Up @@ -205,6 +206,18 @@ jobs:
branch: ${{ inputs.branch }}
secrets: inherit

publish-docker:
if: always() && !failure() && contains(fromJSON('["docker", "all"]'), inputs.target)
needs:
- merge-changes
- bump-version
uses: ./.github/workflows/_publish-docker.yml
with:
package: ${{ inputs.package }}
deploy-to: ${{ inputs.deploy-to }}
version: ${{ needs.bump-version.outputs.final }}
secrets: inherit

clean-up:
if: always()
needs:
Expand Down
File renamed without changes.
37 changes: 0 additions & 37 deletions dbt-bigquery/docker/Dockerfile

This file was deleted.

58 changes: 0 additions & 58 deletions dbt-bigquery/docker/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
RUN python -m pip install --upgrade "hatch==1.13.0" --no-cache-dir --compile


FROM base AS dbt-postgres-dev
FROM base AS dbt-postgres

HEALTHCHECK CMD python --version || exit 1

Expand Down
37 changes: 0 additions & 37 deletions dbt-postgres/docker/Dockerfile

This file was deleted.

File renamed without changes.
37 changes: 0 additions & 37 deletions dbt-redshift/docker/Dockerfile

This file was deleted.

58 changes: 0 additions & 58 deletions dbt-redshift/docker/README.md

This file was deleted.

File renamed without changes.
37 changes: 0 additions & 37 deletions dbt-snowflake/docker/Dockerfile

This file was deleted.

Loading
Loading