-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(docker-nightly): add check for new commits
- 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
1 parent
008cbbe
commit 4d413a3
Showing
1 changed file
with
19 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|