Use reusable maven-unit-test #5
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: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- src/** | ||
- pom.xml | ||
- .github/workflows/* | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- src/** | ||
- pom.xml | ||
- .github/workflows/* | ||
jobs: | ||
test: | ||
uses: making/workflows/.github/workflows/maven-unit-test.yaml@main | ||
Check failure on line 19 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
|
||
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: making/workflows/.github/workflows/save-images.yaml@main | ||
with: | ||
target: image.yaml |