fix docker image #18
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: Build base image for CI | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'Dockerfile' | |
- 'Makefile' | |
workflow_dispatch: | |
# GitHub secrets | |
env: | |
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | |
IMAGE_NAME: dbt-bigquery-monitoring-base | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
build-base-image: | |
name: Build base image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | |
- name: Log in to Docker Hub | |
run: | | |
echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login ${{ secrets.DOCKER_REGISTRY }} -u ${{ secrets.DOCKER_REGISTRY_USER }} --password-stdin | |
- name: Build base image | |
run: | | |
docker build -t $IMAGE_NAME:$BRANCH_NAME . | |
- name: Push base image | |
run: | | |
docker tag $IMAGE_NAME:$BRANCH_NAME $DOCKER_REGISTRY/$IMAGE_NAME:$BRANCH_NAME | |
docker push $DOCKER_REGISTRY/$IMAGE_NAME:$BRANCH_NAME | |