added possibility to set version of n8n
All checks were successful
Build Pipeline for de.captica.n8n / resolve_n8n_version (push) Successful in 1s
Build Pipeline for de.captica.n8n / publish_docker (push) Successful in 5m54s

This commit is contained in:
Tobias Lehmann
2026-03-25 10:59:44 +01:00
parent b4803b0970
commit 7c0a5c8416
2 changed files with 26 additions and 12 deletions

View File

@@ -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

View File

@@ -1,6 +1,6 @@
FROM node:lts-bookworm-slim
ARG VERSION=latest
# Update everything and install needed dependencies
RUN apt-get update -y && \
@@ -17,13 +17,9 @@ RUN apt-get update -y && \
ca-certificates \
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