Skip to content

Create Maven Cache

Create Maven Cache #1

name: Create Maven Cache
on:
workflow_dispatch:
jobs:
create-maven-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Install imgpkg
shell: bash
run: |
wget -nv -O- https://github.com/carvel-dev/imgpkg/releases/download/v0.42.2/imgpkg-linux-amd64 > /tmp/imgpkg
chmod 755 /tmp/imgpkg
- name: Download Spring Boot application
shell: bash
run: |
mkdir -p demo
curl --silent --fail https://start.spring.io/starter.tgz -d dependencies=webflux,actuator -d javaVersion=17 | tar -C demo -xzvf -
- name: Generate dependencies
shell: bash
run: |
(cd demo && ./mvnw dependency:go-offline)
- name: Build and publish
shell: bash
run: |
/tmp/imgpkg push -i ghcr.io/${{github.repository}}-maven:latest -f $HOME/.m2 --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}