Skip to content

Prepare for development of 0.1.4-SNAPSHOT (#21) #14

Prepare for development of 0.1.4-SNAPSHOT (#21)

Prepare for development of 0.1.4-SNAPSHOT (#21) #14

name: Publish Snapshot
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'zulu'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Get cache week
id: date
run: echo "week=$(date +%Y-%W)" >> $GITHUB_OUTPUT
- name: Cache Docker images
id: cache-docker
uses: actions/cache@v4
with:
path: /tmp/docker-images
key: docker-images-${{ runner.os }}-${{ steps.date.outputs.week }}
restore-keys: |
docker-images-${{ runner.os }}-
- name: Load cached Docker images
if: steps.cache-docker.outputs.cache-hit == 'true'
run: docker load -i /tmp/docker-images/images.tar
- name: Pull and save Docker images
if: steps.cache-docker.outputs.cache-hit != 'true'
run: |
docker pull alpine:latest
docker pull nginx:latest
docker pull rabbitmq:latest
mkdir -p /tmp/docker-images
docker save alpine:latest nginx:latest rabbitmq:latest -o /tmp/docker-images/images.tar
- name: Publish Snapshot
run: ./mvnw clean deploy
env:
MAVEN_PUBLISH: "true"
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}