Skip to content

Commit 06340f0

Browse files
committed
[FEATURE] Add build docker container
1 parent 801383c commit 06340f0

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build & Publish Docker image to GHCR
2+
3+
on:
4+
push:
5+
tags: [ "v*.*.*" ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }} # results in "<owner>/<repo>"
15+
16+
jobs:
17+
test-build-publish:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Log in to GHCR
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Extract Docker metadata
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36+
tags: |
37+
type=sha
38+
type=ref,event=branch
39+
type=ref,event=tag
40+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
41+
42+
- name: Build & push image
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: .
46+
file: ./Dockerfile
47+
push: true
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ WORKDIR /app
33
COPY . /app
44
RUN chmod +x && ./gradlew build --no-daemon
55
FROM azul/zulu-openjdk-debian:24-latest AS prod
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
osslsigncode \
8+
nano \
9+
vim \
10+
rsync \
11+
socat \
12+
&& rm -rf /var/lib/apt/lists/*
613
WORKDIR /app/data
714
ENV APP_HOME=/app
815
ENV LISTEN_PORT=9274
916
EXPOSE 9274
17+
VOLUME /app/data
1018
COPY --from=build /app/components/launchserver/build/install/launchserver/* /app
1119
ENTRYPOINT ["/app/bin/launchserver"]

0 commit comments

Comments
 (0)