diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f023adc --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,17 @@ +name: Java CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Maven + run: mvn --batch-mode --update-snapshots package \ No newline at end of file diff --git a/.github/workflows/pub-docker-hub.yaml b/.github/workflows/pub-docker-hub.yaml new file mode 100644 index 0000000..3095f57 --- /dev/null +++ b/.github/workflows/pub-docker-hub.yaml @@ -0,0 +1,29 @@ +name: Publish Docker image to Docker Hub +on: + release: + types: + - published + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.DOCKER_PASSWORD}} + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + server-id: docker.io + server-username: DOCKER_USERNAME + server-password: DOCKER_PASSWORD + - name: Publish package + run: mvn --batch-mode -Prelease package dockerfile:push +env: + DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} + DOCKER_TOKEN: ${{secrets.DOCKER_PASSWORD}} \ No newline at end of file diff --git a/.github/workflows/pub.yaml b/.github/workflows/pub.yaml new file mode 100644 index 0000000..15a617a --- /dev/null +++ b/.github/workflows/pub.yaml @@ -0,0 +1,26 @@ +name: Publish package to the Maven Central Repository +on: + release: + types: [released] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_TOKEN + gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}} + gpg-passphrase: GPG_PASSPHRASE + - name: Publish package + run: mvn --batch-mode -Prelease deploy +env: + GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}} + OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}} + OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}