π¦ Build custom Docker image and push to Docker Hub #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π¦ Build custom Docker image and push to Docker Hub | |
# Workflow triggered manually (GitHub UI) or programmatically by the check-n8n-new-release workflow | |
on: | |
workflow_call: | |
inputs: | |
n8n_version: | |
description: 'n8n version to build. Example: 1.20.0' | |
required: true | |
type: string | |
workflow_dispatch: | |
inputs: | |
n8n_version: | |
description: 'n8n version to build. Example: 1.20.0' | |
required: true | |
type: string | |
jobs: | |
push-docker-image: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
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: . | |
push: true | |
tags: codelytvtech/n8n-custom-image:${{ inputs.n8n_version }} | |
create-release: | |
needs: push-docker-image | |
runs-on: ubuntu-latest | |
timeout-minutes: 1 | |
permissions: | |
contents: write | |
steps: | |
- name: π·οΈ Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
commit: main | |
tag: n8n@${{ inputs.n8n_version }} |