Add schedule & concurrency to CI workflow

* The `schedule` allows to have a fresh snapshot every night (`--rerun-tasks` should ensure we build against cache)
* The `concurrency` allows to cancel previously running and scheduled workflows: only the last built SNAPSHOT matters
This commit is contained in:
Artem Bilan
2024-01-04 16:23:25 -05:00
parent f6cb25742b
commit 38f0ca077c

View File

@@ -2,15 +2,26 @@ name: CI SNAPSHOT
on:
workflow_dispatch:
push:
branches:
- main
- '*.x'
schedule:
- cron: '0 5 * * *'
concurrency:
group: group-snapshot-for-${{ github.ref }}
cancel-in-progress: true
jobs:
build-snapshot:
uses: spring-io/spring-github-workflows/.github/workflows/spring-artifactory-gradle-snapshot.yml@v2
with:
gradleTasks: ${{ github.event_name == 'schedule' && '--rerun-tasks' || '' }}
secrets:
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}