-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add build files * Change branch name to main * Update .github/workflows/build-image-dev.yml Co-authored-by: Derek Ellis <[email protected]> * Update Dockerfile Co-authored-by: Derek Ellis <[email protected]> Co-authored-by: Derek Ellis <[email protected]>
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 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,26 @@ | ||
name: Build watershed development image | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-server-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Authenticate package registry | ||
run: echo "${{ secrets.CONTAINER_TOKEN }}" | docker login https://ghcr.io -u ${GITHUB_ACTOR} --password-stdin | ||
|
||
- name: Get tag | ||
run: echo "BUILD_TAG=$(git describe --tags)" >> $GITHUB_ENV | ||
|
||
- name: Build and tag image | ||
run: docker build -t ghcr.io/cuhacking/watershed:${BUILD_TAG} -t ghcr.io/cuhacking/watershed:dev . | ||
|
||
- name: Push image | ||
if: success() | ||
run: docker push --all-tags ghcr.io/cuhacking/watershed |
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,15 @@ | ||
FROM gradle:jdk15 AS builder | ||
|
||
COPY . /home/gradle/src | ||
WORKDIR /home/gradle/src | ||
|
||
RUN gradle :server:shadowJar | ||
|
||
FROM openjdk:15 | ||
|
||
COPY --from=builder /home/gradle/src/server/build/libs /usr/src/app | ||
WORKDIR /usr/src/app | ||
EXPOSE 8080 | ||
CMD ["java", "-jar", "server-all.jar"] | ||
|
||
LABEL org.opencontainers.image.source https://github.com/cuhacking/watershed |
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