Skip to content

Commit

Permalink
Added GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhorridge committed May 11, 2024
1 parent c9330d0 commit 3e2292b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions .github/workflows/pub-docker-hub.yaml
Original file line number Diff line number Diff line change
@@ -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}}

0 comments on commit 3e2292b

Please sign in to comment.