π Check for new n8n stable releases and builds a new custom image release if needed #16
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: π Check for new n8n stable releases | |
on: | |
schedule: | |
- cron: '0 8 * * *' # Every day at 8am | |
workflow_dispatch: | |
jobs: | |
check-new-release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
contents: write | |
outputs: | |
n8n_version_to_release: ${{ steps.n8n_version.outputs.version_to_release }} | |
steps: | |
- name: π Get the latest custom image stable release | |
id: custom_image_release | |
uses: pozetroninc/[email protected] | |
with: | |
repository: CodelyTV/n8n-codely-custom-image | |
excludes: prerelease,draft | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Get the latest n8n stable release | |
id: n8n_release | |
uses: pozetroninc/[email protected] | |
with: | |
repository: n8n-io/n8n | |
excludes: prerelease,draft | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: π€² Compare n8n release versions | |
id: compare_releases | |
run: | | |
echo "π Latest Codely custom image release: ${{ steps.custom_image_release.outputs.release }}" | |
echo "π Latest n8n release: ${{ steps.n8n_release.outputs.release }}" | |
if [ "${{ steps.custom_image_release.outputs.release }}" != "${{ steps.n8n_release.outputs.release }}" ]; then | |
echo "release_changed=true" >> $GITHUB_OUTPUT | |
echo "π€© New release detected! Releasing new custom image version in 1, 2β¦" | |
else | |
echo "release_changed=false" >> $GITHUB_OUTPUT | |
echo "π Release has not changed. Doing nothing." | |
fi | |
- name: π‘ Remove 'n8n@' from release name to get the version | |
id: n8n_version | |
if: steps.compare_releases.outputs.release_changed == 'true' | |
run: | | |
version_to_release=$(echo "${{ steps.n8n_release.outputs.release }}" | sed 's/n8n@//g') | |
echo "version_to_release=$version_to_release" >> $GITHUB_OUTPUT | |
build-and-push-new-docker-image: | |
needs: check-new-release | |
uses: ./.github/workflows/build-and-push.yml | |
with: | |
n8n_version: ${{ needs.check-new-release.outputs.n8n_version_to_release }} | |
secrets: inherit | |
create-release: | |
needs: [check-new-release, build-and-push-new-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: ${{ needs.check-new-release.outputs.n8n_version_to_release }} |