Skip to content

Fix CD pipeline

Fix CD pipeline #2

Workflow file for this run

---
name: CD pipeline
on:
push:
branches:
- main
- docker-to-ghcr
jobs:
cd_pipeline:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
dbt-bouncer
tags: |
type=ref,event=branch
type=raw,value=${{ github.sha }}
type=raw,value=test
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine python version
id: python-version
run: |
export PYTHON_VERSION=$(cat .python-version)
echo "PYTHON_VERSION: $PYTHON_VERSION"
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_OUTPUT
- name: Build image
uses: docker/build-push-action@v5
with:
build-args: PYTHON_VERSION=${{ steps.python-version.outputs.PYTHON_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
load: false
push: false
tags: ${{ steps.meta.outputs.tags }}