Skip to content

Commit

Permalink
ci(docker-nightly): add check for new commits
Browse files Browse the repository at this point in the history
- check for commits in the last 24 hours and only run if there
were some.
- add option to ignore check and definitely build image
  • Loading branch information
TheGreatRefrigerator committed Feb 14, 2024
1 parent 008cbbe commit 4d413a3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/docker-nightly-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,33 @@ on:
description: 'Name of the docker tag to create.'
required: true
default: 'nightly'
ignore-24h-commit-check:
description: 'Build image regardless of last commit date.'
required: true
type: boolean
default: false
user:
description: ''
required: false
default: 'schedule'

jobs:
build:
check-commits:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
repository: ${{ github.event.inputs.repository || 'GIScience/openrouteservice' }}
ref: ${{ github.event.inputs.branch || 'main' }}

- name: Check for new commits since 24 h ago
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV

build:
needs: check-commits
runs-on: ubuntu-latest
if: ${{ github.event.inputs.ignore-24h-commit-check || env.NEW_COMMIT_COUNT > 0 }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down

0 comments on commit 4d413a3

Please sign in to comment.