Skip to content

Commit 14fdf0f

Browse files
committed
build: publish icey-server image on release
1 parent 1b8609b commit 14fdf0f

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,62 @@ jobs:
4646
BUILD_DIR: ${{ github.workspace }}/build-release
4747
run: ./scripts/package-manager-check.sh
4848

49+
- name: Check Docker Hub credentials
50+
if: startsWith(github.ref, 'refs/tags/')
51+
env:
52+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
53+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
54+
run: |
55+
test -n "$DOCKERHUB_USERNAME" || {
56+
echo "DOCKERHUB_USERNAME is required to publish the 0state/icey-server image" >&2
57+
exit 1
58+
}
59+
test -n "$DOCKERHUB_TOKEN" || {
60+
echo "DOCKERHUB_TOKEN is required to publish the 0state/icey-server image" >&2
61+
exit 1
62+
}
63+
64+
- name: Derive image version
65+
if: startsWith(github.ref, 'refs/tags/')
66+
id: image_version
67+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
68+
69+
- name: Set up Docker Buildx
70+
if: startsWith(github.ref, 'refs/tags/')
71+
uses: docker/setup-buildx-action@v3
72+
73+
- name: Log in to Docker Hub
74+
if: startsWith(github.ref, 'refs/tags/')
75+
uses: docker/login-action@v3
76+
with:
77+
username: ${{ secrets.DOCKERHUB_USERNAME }}
78+
password: ${{ secrets.DOCKERHUB_TOKEN }}
79+
80+
- name: Extract image metadata
81+
if: startsWith(github.ref, 'refs/tags/')
82+
id: image_meta
83+
uses: docker/metadata-action@v5
84+
with:
85+
images: 0state/icey-server
86+
tags: |
87+
type=raw,value=${{ steps.image_version.outputs.version }}
88+
type=raw,value=latest
89+
90+
- name: Build and push image
91+
if: startsWith(github.ref, 'refs/tags/')
92+
uses: docker/build-push-action@v6
93+
with:
94+
context: .
95+
file: ./docker/Dockerfile
96+
push: true
97+
build-args: |
98+
ICEY_SERVER_BINARY=build-release/src/server/icey-server
99+
ICEY_WEB_ROOT=web/dist
100+
ICEY_SAMPLE_MEDIA=icey/data/test.mp4
101+
ICEY_ENTRYPOINT=docker/entrypoint.sh
102+
tags: ${{ steps.image_meta.outputs.tags }}
103+
labels: ${{ steps.image_meta.outputs.labels }}
104+
49105
- name: Upload release assets
50106
uses: softprops/action-gh-release@v2
51107
if: startsWith(github.ref, 'refs/tags/')

docker/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ FROM ubuntu:24.04
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
ARG ICEY_SERVER_BINARY=icey-cli/build-dev/src/server/icey-server
5+
ARG ICEY_WEB_ROOT=icey-cli/web/dist
6+
ARG ICEY_SAMPLE_MEDIA=icey/data/test.mp4
7+
ARG ICEY_ENTRYPOINT=icey-cli/docker/entrypoint.sh
58

69
RUN apt-get update && apt-get install -y --no-install-recommends \
710
ca-certificates \
@@ -14,9 +17,9 @@ WORKDIR /app
1417
RUN mkdir -p /app/media /app/recordings
1518

1619
COPY ${ICEY_SERVER_BINARY} /usr/local/bin/icey-server
17-
COPY icey-cli/web/dist /app/web
18-
COPY icey/data/test.mp4 /app/media/test.mp4
19-
COPY icey-cli/docker/entrypoint.sh /app/entrypoint.sh
20+
COPY ${ICEY_WEB_ROOT} /app/web
21+
COPY ${ICEY_SAMPLE_MEDIA} /app/media/test.mp4
22+
COPY ${ICEY_ENTRYPOINT} /app/entrypoint.sh
2023

2124
RUN chmod +x /app/entrypoint.sh
2225

0 commit comments

Comments
 (0)