DM-44270: Use build-and-push-to-ghcr #22
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: 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 Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt-openj9' | |
java-version: '17' | |
- 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 | |
run: | | |
make MVN_ARGS='-DskipTests -DskipITs' all | |
env: | |
DOCKER_ORG: lsst-sqre | |
PROJECT_NAME: kafka-access-operator | |
DOCKER_REGISTRY: ghcr.io | |
# - 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 |