Skip to content

Commit

Permalink
ci: Fix nightly image not being pushed to ghcr
Browse files Browse the repository at this point in the history
Pushing of nightly images to ghcr was added in #10580. However, when
the workflow runs on a cron schedule, it does not have inputs. Hence
the checks were failing. This fixes it so that the default value is used
in the if conditions.
  • Loading branch information
tomi committed Aug 30, 2024
1 parent 7e9d186 commit 64ca966
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/docker-images-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ on:
required: false
default: ''

env:
N8N_TAG: ${{ inputs.tag || 'nightly' }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,18 +79,18 @@ jobs:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ secrets.DOCKER_USERNAME }}/n8n:${{ github.event.inputs.tag || 'nightly' }}
tags: ${{ secrets.DOCKER_USERNAME }}/n8n:${{ env.N8N_TAG }}

- name: Login to GitHub Container Registry
if: github.event.inputs.tag == 'nightly'
if: env.N8N_TAG == 'nightly'
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image to GHCR
if: github.event.inputs.tag == 'nightly'
if: env.N8N_TAG == 'nightly'
run: |
docker buildx imagetools create \
--tag ghcr.io/${{ github.repository_owner }}/n8n:nightly \
Expand Down

0 comments on commit 64ca966

Please sign in to comment.