-
-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# ignore everything | ||
* | ||
|
||
# allow only what we need | ||
!commafeed-server/target/commafeed.jar | ||
!commafeed-server/config.yml.example |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,48 @@ | ||
name: Java CI | ||
|
||
on: [push] | ||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: ["8", "11", "17"] | ||
java: [ "8", "11", "17" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: "temurin" | ||
cache: "maven" | ||
|
||
- name: Build with Maven | ||
run: mvn --batch-mode --update-snapshots verify | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.java == '8' }} | ||
with: | ||
name: commafeed.jar | ||
path: commafeed-server/target/commafeed.jar | ||
|
||
# Docker | ||
- name: Login to Container Registry | ||
if: ${{ github.ref_type == 'tag' && matrix.java == '8' }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.ref_type == 'tag' && matrix.java == '8' }} | ||
tags: | | ||
athou/commafeed:latest | ||
athou/commafeed:${{ github.ref_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM openjdk:17-alpine | ||
|
||
RUN mkdir -p /commafeed/data | ||
VOLUME /commafeed/data | ||
|
||
ENV CF_SESSION_PATH=/commafeed/data/sessions | ||
|
||
COPY commafeed-server/target/commafeed.jar . | ||
COPY commafeed-server/config.yml.example config.yml | ||
|
||
EXPOSE 8082 | ||
CMD ["java", "-Djava.net.preferIPv4Stack=true", "-jar", "commafeed.jar", "server", "config.yml"] |
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