Skip to content

DM-44270: Use build-and-push-to-ghcr #19

DM-44270: Use build-and-push-to-ghcr

DM-44270: Use build-and-push-to-ghcr #19

Workflow file for this run

name: CI
"on":
merge_group: {}
pull_request: {}
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
# (optional) only build on tags or ticket branches
if: >
startsWith(github.ref, 'refs/tags/')
|| startsWith(github.head_ref, 'tickets/')
steps:
- uses: actions/checkout@v4
- name: Define the tag
id: tag
shell: bash
run: echo "tag=`bash scripts/docker-tag.sh`" >> ${GITHUB_OUTPUT}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v5
with:
context: "."
file: "Dockerfile"
tags: |
ghcr.io/lsst-sqre/kafka-access-operator:${{ steps.tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max