2020-12-29 06:00:57 -08:00
|
|
|
name: Docker Nightly Image CI
|
2022-12-02 10:56:29 -08:00
|
|
|
run-name: Build ${{ inputs.branch }} - ${{ inputs.user }}
|
2020-12-29 06:00:57 -08:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2022-02-09 05:23:07 -08:00
|
|
|
- cron: '0 1 * * *'
|
2020-12-29 06:00:57 -08:00
|
|
|
workflow_dispatch:
|
2020-12-29 11:27:48 -08:00
|
|
|
inputs:
|
2022-02-09 05:23:07 -08:00
|
|
|
repository:
|
|
|
|
description: 'GitHub repository to create image off.'
|
|
|
|
required: true
|
|
|
|
default: 'n8n-io/n8n'
|
2020-12-29 11:27:48 -08:00
|
|
|
branch:
|
2022-02-09 05:23:07 -08:00
|
|
|
description: 'GitHub branch to create image off.'
|
2020-12-29 11:27:48 -08:00
|
|
|
required: true
|
|
|
|
default: 'master'
|
|
|
|
tag:
|
|
|
|
description: 'Name of the docker tag to create.'
|
|
|
|
required: true
|
|
|
|
default: 'nightly'
|
2022-02-10 05:14:55 -08:00
|
|
|
merge-master:
|
|
|
|
description: 'Merge with master.'
|
|
|
|
type: boolean
|
|
|
|
required: true
|
|
|
|
default: false
|
2022-12-02 10:56:29 -08:00
|
|
|
user:
|
|
|
|
description: ''
|
|
|
|
required: false
|
|
|
|
default: 'schedule'
|
|
|
|
start-url:
|
|
|
|
description: 'URL to call after workflow is kicked off.'
|
|
|
|
required: false
|
|
|
|
default: ''
|
2022-02-25 10:39:35 -08:00
|
|
|
success-url:
|
|
|
|
description: 'URL to call after Docker Image got built successfully.'
|
|
|
|
required: false
|
|
|
|
default: ''
|
2020-12-29 06:00:57 -08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-12-02 10:56:29 -08:00
|
|
|
- name: Call Start URL - optionally
|
|
|
|
run: |
|
|
|
|
[[ "${{github.event.inputs.start-url}}" != "" ]] && curl -v -X POST -d 'url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' ${{github.event.inputs.start-url}} || echo ""
|
|
|
|
shell: bash
|
|
|
|
|
2022-02-09 05:23:07 -08:00
|
|
|
- name: Checkout
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/checkout@v4.1.1
|
2020-12-29 11:27:48 -08:00
|
|
|
with:
|
2022-02-12 03:37:53 -08:00
|
|
|
repository: ${{ github.event.inputs.repository || 'n8n-io/n8n' }}
|
2020-12-31 03:17:00 -08:00
|
|
|
ref: ${{ github.event.inputs.branch || 'master' }}
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-02-09 05:23:07 -08:00
|
|
|
- name: Set up QEMU
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-02-09 05:23:07 -08:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-02-09 05:23:07 -08:00
|
|
|
- name: Login to DockerHub
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: docker/login-action@v3.0.0
|
2020-12-29 06:00:57 -08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-02-10 05:14:55 -08:00
|
|
|
- name: Merge Master - optionally
|
|
|
|
run: |
|
2022-02-10 05:41:42 -08:00
|
|
|
[[ "${{github.event.inputs.merge-master}}" == "true" ]] && git remote add upstream https://github.com/n8n-io/n8n.git -f; git merge upstream/master --allow-unrelated-histories || echo ""
|
2022-02-10 05:14:55 -08:00
|
|
|
shell: bash
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-02-09 05:23:07 -08:00
|
|
|
- name: Build and push
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: docker/build-push-action@v5.1.0
|
2020-12-29 06:00:57 -08:00
|
|
|
with:
|
|
|
|
context: .
|
2024-01-26 04:18:49 -08:00
|
|
|
file: ./docker/images/n8n-custom/Dockerfile
|
2023-10-03 11:49:04 -07:00
|
|
|
build-args: |
|
|
|
|
N8N_RELEASE_TYPE=nightly
|
2024-01-26 04:18:49 -08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2023-03-06 00:53:50 -08:00
|
|
|
provenance: false
|
2020-12-29 06:00:57 -08:00
|
|
|
push: true
|
2024-01-26 04:18:49 -08:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
2022-08-31 06:25:52 -07:00
|
|
|
tags: ${{ secrets.DOCKER_USERNAME }}/n8n:${{ github.event.inputs.tag || 'nightly' }}
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-02-25 10:39:35 -08:00
|
|
|
- name: Call Success URL - optionally
|
|
|
|
run: |
|
2022-02-25 10:58:35 -08:00
|
|
|
[[ "${{github.event.inputs.success-url}}" != "" ]] && curl -v ${{github.event.inputs.success-url}} || echo ""
|
2022-02-25 10:39:35 -08:00
|
|
|
shell: bash
|