-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check to only run nightly if changes in the past 24 hours
- Loading branch information
1 parent
e58dad0
commit 230f505
Showing
5 changed files
with
45 additions
and
9 deletions.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: check-date | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check_date: | ||
runs-on: ubuntu-latest | ||
name: Check latest commit | ||
outputs: | ||
should_run: ${{ steps.should_run.outputs.should_run }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: print latest_commit | ||
run: echo ${{ github.sha }} | ||
- id: should_run | ||
continue-on-error: true | ||
name: check latest commit is less than a day | ||
if: ${{ github.event_name == 'schedule' }} | ||
run: test -z $(git rev-list --after="23 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: nightly | ||
|
||
on: | ||
schedule: | ||
- cron: "4 3 * * *" | ||
jobs: | ||
nightly-publish-check: | ||
name: Nightly publish check | ||
runs-on: ubuntu-latest | ||
needs: check_date | ||
if: ${{ needs.check_date.outputs.should_run != 'false' }} | ||
steps: | ||
- name: Build and publish nightly | ||
uses: ./.github/workflows/release.yml | ||
secrets: inherit | ||
with: | ||
build_type: ${{ inputs.release_type == '' && 'nightly' || inputs.release_type }} |
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
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
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