From 7b62022a83aa66bba0c18c71dd3360c5abe26ce9 Mon Sep 17 00:00:00 2001 From: edraft Date: Fri, 18 Apr 2025 11:15:15 +0200 Subject: [PATCH] Updated build --- .gitea/workflows/build dev.yaml | 5 ++++- .gitea/workflows/build.yaml | 4 +++- web/dockerfile | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build dev.yaml b/.gitea/workflows/build dev.yaml index 1ff30d3..b7aab73 100644 --- a/.gitea/workflows/build dev.yaml +++ b/.gitea/workflows/build dev.yaml @@ -54,6 +54,7 @@ jobs: uses: actions/download-artifact@v3 with: name: version + path: version.txt - name: Build docker run: | @@ -86,6 +87,7 @@ jobs: uses: actions/download-artifact@v3 with: name: version + path: version.txt - name: Build docker run: | @@ -117,6 +119,7 @@ jobs: uses: actions/download-artifact@v3 with: name: version + path: version.txt - name: Prepare web build run: | @@ -131,7 +134,7 @@ jobs: - name: Build docker run: | cd web - docker build --no-cache -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) . + docker build --no-cache --build-arg VERSION=$(cat version.txt) -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) . - name: Login to registry git.sh-edraft.de uses: https://github.com/docker/login-action@v1 diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1e51a43..5990a07 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -86,6 +86,7 @@ jobs: uses: actions/download-artifact@v3 with: name: version + path: version.txt - name: Build docker run: | @@ -117,6 +118,7 @@ jobs: uses: actions/download-artifact@v3 with: name: version + path: version.txt - name: Prepare web build run: | @@ -131,7 +133,7 @@ jobs: - name: Build docker run: | cd web - docker build --no-cache -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) . + docker build --no-cache --build-arg VERSION=$(cat version.txt) -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) . - name: Login to registry git.sh-edraft.de uses: https://github.com/docker/login-action@v1 diff --git a/web/dockerfile b/web/dockerfile index ee46f58..f69edb6 100644 --- a/web/dockerfile +++ b/web/dockerfile @@ -4,4 +4,8 @@ RUN rm -rf /usr/share/nginx/html/* COPY ./dist/open-redirect/browser/ /usr/share/nginx/html RUN apk update RUN apk add bash + +ARG VERSION +RUN echo "{\"version\": \"${VERSION}\"}" > /usr/share/nginx/html/assets/version.json + CMD /bin/bash -c "envsubst '\$CONTAINER_NAME' < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/nginx.conf; nginx -g 'daemon off;'"