Skip to content

Commit

Permalink
ci: use native build-args instead of manual sed for specifying n8…
Browse files Browse the repository at this point in the history
…n version
  • Loading branch information
JavierCane committed Dec 28, 2023
1 parent 596c755 commit 244b553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Replace n8n version in Dockerfile
run: sed -i 's/{N8N_VERSION}/${{ inputs.n8n_version }}/g' Dockerfile

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
build-args: N8N_VERSION=${{ inputs.n8n_version }}
push: true
tags: codelytvtech/n8n-custom-image:${{ inputs.n8n_version }}

Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM n8nio/n8n:{N8N_VERSION}
ARG N8N_VERSION
FROM n8nio/n8n:${N8N_VERSION}

RUN if [ -z "$N8N_VERSION" ] ; then echo "✋ The N8N_VERSION argument is missing!" ; exit 1; fi

USER root

Expand Down

0 comments on commit 244b553

Please sign in to comment.