From ec975e9083e6b7abae1a11005a58eaf15b37c4a0 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:59:25 -0400 Subject: [PATCH] Add versioning --- .github/workflows/BuildImage.yml | 2 +- Dockerfile | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index f1c0bd35..5fe0dac8 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -20,7 +20,7 @@ jobs: echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT # **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. **** - MOD_VERSION="" + MOD_VERSION="curl -fsSL https://api.github.com/repos/linuxserver/reverse-proxy-confs/commits/master | jq -r '.sha'" echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT outputs: GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }} diff --git a/Dockerfile b/Dockerfile index 8edafe1f..c91ddada 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,28 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as grab-stage +FROM ghcr.io/linuxserver/baseimage-alpine:3.20 AS grab-stage + +ARG MOD_VERSION RUN \ apk add --no-cache --upgrade \ tar && \ mkdir -p /root/defaults/nginx/proxy-confs && \ + if [[ -z "${MOD_VERSION}" ]]; then \ + MOD_VERSION=$(curl -fsSL https://api.github.com/repos/linuxserver/reverse-proxy-confs/commits/master | jq -r '.sha'); \ + fi && \ curl -o \ /tmp/proxy.tar.gz -L \ - "https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \ + "https://github.com/linuxserver/reverse-proxy-confs/archive/${MOD_VERSION}.tar.gz" && \ tar xf \ /tmp/proxy.tar.gz -C \ /root/defaults/nginx/proxy-confs \ --strip-components=1 \ - --exclude=linux*/.gitattributes \ - --exclude=linux*/.github \ - --exclude=linux*/.gitignore \ - --exclude=linux*/LICENSE + --exclude=reverse*/.editorconfig \ + --exclude=reverse*/.gitattributes \ + --exclude=reverse*/.github \ + --exclude=reverse*/.gitignore \ + --exclude=reverse*/LICENSE # copy local files COPY root/ root/