Create a job for pushing images automatically #11
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 | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
push: | |
branches: | |
- main | |
- build-job | |
paths-ignore: | |
- '**.md' | |
jobs: | |
build: | |
if: github.repository_owner == 'hawtio' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java: ['17', '21'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
cache: 'maven' | |
- name: Build | |
run: | | |
mvn --batch-mode --no-transfer-progress install -Djkube.build.strategy=docker | |
- name: Push image to Quay.io | |
env: | |
USERNAME: ${{ secrets.QUAY_USERNAME }} | |
PASSWORD: ${{ secrets.QUAY_PASSWORD }} | |
run: | | |
docker login --help | |
docker login -u $USERNAME -p $PASSWORD quay.io | |
docker tag quay.io/hawtio/hawtio-online-example-camel-quarkus:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:${{matrix.java}} | |
docker tag quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}} | |
docker push quay.io/hawtio/hawtio-online-example-camel-quarkus:${{matrix.java}} | |
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}} |