Skip to content

Polish build image workflows #5

Polish build image workflows

Polish build image workflows #5

Workflow file for this run

name: Build and Push Custom Dbt Image
on:
pull_request:
branches:
- main
paths:
- "data_pipeline/requirements-dbt.txt"
- "data_pipeline/requirements-gooddata.txt"
- "data_pipeline/packages.yml"
- "data_pipeline/dbt_project.yml"
- "Dockerfile_dbt"
- ".github/workflows/build-dbt.yml"
- ".github/variables/image-dbt.env"
jobs:
build-and-push-custom-dbt-image:
env:
GIT_DEPTH: "0"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set Environment Variables
uses: ./.github/actions/setvars
with:
varFilePath: ./.github/variables/image-dbt.env
- name: Build custom dbt Image
timeout-minutes: 10
run: |
docker build --build-arg DBT_VERSION=${{ env.DBT_VERSION }} --build-arg IMAGES_WORKDIR=${{ env.IMAGES_WORKDIR }} -t ghcr.io/$GITHUB_REPOSITORY/${{ env.DBT_CUSTOM_IMAGE }} -f Dockerfile_dbt .
- name: Push custom dbt Image
timeout-minutes: 10
run: |
docker push ghcr.io/$GITHUB_REPOSITORY/${{ env.DBT_CUSTOM_IMAGE }}