Skip to content

Commit

Permalink
ci: fix call between workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCane committed Dec 28, 2023
1 parent e80e88a commit 9a16292
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ on:

jobs:
docker:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Check inputs
id: n8n_version
run: |
echo "👍 n8n_version: ${{ github.event.inputs.n8n_version }}"
- name: Checkout
uses: actions/checkout@v4

Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/check-n8n-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ on:
workflow_dispatch:

jobs:
check:
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
Expand Down Expand Up @@ -49,18 +52,28 @@ jobs:
id: n8n_version
if: steps.compare_releases.outputs.release_changed == 'true'
run: |
version=$(echo "${{ steps.n8n_release.outputs.release }}" | sed 's/n8n@//g')
echo "version=$version" >> $GITHUB_OUTPUT
version_to_release=$(echo "${{ steps.n8n_release.outputs.release }}" | sed 's/n8n@//g')
echo "version_to_release=$version_to_release" >> $GITHUB_OUTPUT
- name: 🐳 Execute Build Docker image and push to Docker Hub workflow
if: steps.compare_releases.outputs.release_changed == 'true'
uses: ./.github/workflows/build-and-push.yml
with:
n8n_version: ${{ steps.n8n_version.outputs.version }}
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: '${{ steps.n8n_release.outputs.release }}'

tag: ${{ needs.check-new-release.outputs.n8n_version_to_release }}

0 comments on commit 9a16292

Please sign in to comment.