diff --git a/.gitea/workflows/pipeline-build.yaml b/.gitea/workflows/pipeline-build.yaml index 93e0680..2b92452 100644 --- a/.gitea/workflows/pipeline-build.yaml +++ b/.gitea/workflows/pipeline-build.yaml @@ -4,9 +4,27 @@ run-name: ${{ gitea.actor }} pushed new changes to ${{ gitea.branch }} on: push: schedule: - - cron: '0 3 * * *' + - cron: '0 3 * * 1' # each monday jobs: - Publish Docker: + resolve_n8n_version: + runs-on: docker-ubuntu + outputs: + version: ${{ steps.get_version.outputs.version }} + steps: + - name: Get latest n8n version + id: get_version + shell: bash + run: | + VERSION="2.11.3" + #VERSION="$(npm view n8n version)" # using last stable version + echo "Using version=$VERSION" + echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" + + publish_docker: + needs: resolve_n8n_version uses: captica-oss/de.captica.expert.devops/.gitea/workflows/publish-docker.yaml@main + with: + build_args: | + VERSION=${{ needs.resolve_n8n_version.outputs.VERSION }} secrets: inherit \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 026c80a..0ba1849 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:lts-bookworm-slim - +ARG VERSION=latest # Update everything and install needed dependencies RUN apt-get update -y && \ @@ -8,22 +8,18 @@ RUN apt-get update -y && \ apt-get install -y -q \ graphicsmagick \ tzdata \ - curl \ + curl \ zip \ unzip \ jq \ sed \ python3 \ ca-certificates \ - build-essential + build-essential -# Install n8n and the also temporary all the packages -# it needs to build it correctly. -#RUN N8N_VERSION=$(curl -s https://api.github.com/repos/n8n-io/n8n/releases/latest | jq -r '.tag_name' | sed 's/^v//') && \ -RUN N8N_VERSION=n8n@2.11.3 && \ - echo "Latest n8n version: ${N8N_VERSION}" && \ - npm_config_user=root npm install -g \ - ${N8N_VERSION} && \ +# Install n8n and temporarily all packages it needs to build correctly. +RUN echo "Installing n8n version: ${VERSION}" && \ + npm_config_user=root npm install -g "n8n@${VERSION}" && \ apt-get remove -y build-essential && \ apt-get autoremove -y && \ apt-get clean all