build(deps): bump spotless-maven-plugin from 2.37.0 to 2.38.0 #249
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: CI build and push | |
concurrency: | |
group: ci-${{ github.run_id }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- main | |
- v[0-9]+ | |
- v[0-9]+.[0-9]+ | |
- cryostat-v[0-9]+.[0-9]+ | |
pull_request_target: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- labeled | |
- unlabeled | |
branches: | |
- main | |
- v[0-9]+ | |
- v[0-9]+.[0-9]+ | |
- cryostat-v[0-9]+.[0-9]+ | |
jobs: | |
get-pom-properties: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fail if PR and safe-to-test label NOT applied | |
if: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe-to-test') }} | |
run: exit 1 | |
- uses: actions/checkout@v2 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- id: query-pom | |
name: Get properties from POM | |
# Query POM image version and save as output parameter | |
run: | | |
IMAGE_VERSION="$(mvn validate help:evaluate -Dexpression=quarkus.container-image.tag -q -DforceStdout)" | |
echo "::set-output name=image-version::$IMAGE_VERSION" | |
outputs: | |
image-version: ${{ steps.query-pom.outputs.image-version }} | |
build: | |
runs-on: ubuntu-latest | |
needs: [get-pom-properties] | |
env: | |
CRYOSTAT_REPORTS_IMG: quay.io/cryostat/cryostat-reports | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
submodules: true | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: maven-settings | |
uses: s4u/maven-settings-action@v2 | |
with: | |
servers: '[{"id": "github", "username": "dummy", "password": "${env.GITHUB_TOKEN_REF}"}]' | |
githubServer: false | |
- uses: skjolber/maven-cache-github-action@v1 | |
with: | |
step: restore | |
- run: mvn -B -U clean verify | |
env: | |
GITHUB_TOKEN_REF: ${{ secrets.GH_PKGS_READ_TOKEN }} | |
- name: Tag images | |
id: tag-image | |
env: | |
IMAGE_VERSION: ${{ needs.get-pom-properties.outputs.image-version }} | |
run: | | |
if [ "$GITHUB_REF" == "refs/heads/main" ]; then | |
podman tag \ | |
${{ env.CRYOSTAT_REPORTS_IMG }}:$IMAGE_VERSION \ | |
${{ env.CRYOSTAT_REPORTS_IMG }}:latest | |
echo "::set-output name=tags::$IMAGE_VERSION latest" | |
else | |
echo "::set-output name=tags::$IMAGE_VERSION" | |
fi | |
if: ${{ github.event_name == 'push' && github.repository_owner == 'cryostatio' }} | |
- uses: skjolber/maven-cache-github-action@v1 | |
with: | |
step: save | |
- name: Push to quay.io | |
id: push-to-quay | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: cryostat-reports | |
tags: ${{ steps.tag-image.outputs.tags }} | |
registry: quay.io/cryostat | |
username: cryostat+bot | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
if: ${{ github.event_name == 'push' && github.repository_owner == 'cryostatio' }} | |
- name: Print image URL | |
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" | |
if: ${{ github.event_name == 'push' && github.repository_owner == 'cryostatio' }} |