Skip to content

Bump io.spring.javaformat:spring-javaformat-maven-plugin (#1) #3

Bump io.spring.javaformat:spring-javaformat-maven-plugin (#1)

Bump io.spring.javaformat:spring-javaformat-maven-plugin (#1) #3

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths:
- src/**
- pom.xml
- .github/workflows/*
pull_request:
branches:
- main
paths:
- src/**
- pom.xml
- .github/workflows/*
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
cache: 'maven'
- name: mvn test
env:
_JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
run: ./mvnw -V --no-transfer-progress test
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: target
build-jvm-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: test
steps:
- uses: actions/checkout@v2
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
cache: 'maven'
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: target
- name: build image
run: ./mvnw -V --no-transfer-progress spring-boot:build-image -DskipTests -Dspring-boot.build-image.imageName=ghcr.io/${{ github.repository }}:jvm_${GITHUB_SHA}
- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker push
if: github.ref == 'refs/heads/main'
run: |
docker push ghcr.io/${{ github.repository }}:jvm_${GITHUB_SHA}
docker tag ghcr.io/${{ github.repository }}:jvm_${GITHUB_SHA} ghcr.io/${{ github.repository }}:jvm
docker push ghcr.io/${{ github.repository }}:jvm
- name: Generate digest
if: github.ref == 'refs/heads/main'
run: |
cat <<EOF > image.yaml
image: $(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository }}:jvm_${GITHUB_SHA})
git_revision: ${GITHUB_SHA}
EOF
- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: image
path: image.yaml
save-image-jvm:
if: github.ref == 'refs/heads/main'
needs: build-jvm-image
uses: ./.github/workflows/save-images.yaml
with:
target: image.yaml