mirror of
https://github.com/1technophile/OpenMQTTGateway.git
synced 2026-03-13 07:31:44 +08:00
[CI] Skip nightly dev build when no changes in the last 24 hours (#2290)
The prepare job now checks for commits in the last 24 hours before proceeding. If there are no changes, the firmware build and docs deploy are skipped, saving CI minutes. Manual triggers always run. Co-authored-by: Florian <1technophile@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
19
.github/workflows/build_and_docs_to_dev.yml
vendored
19
.github/workflows/build_and_docs_to_dev.yml
vendored
@@ -11,15 +11,33 @@ jobs:
|
||||
if: github.repository_owner == '1technophile'
|
||||
outputs:
|
||||
short-sha: ${{ steps.short-sha.outputs.sha }}
|
||||
has-changes: ${{ steps.check-changes.outputs.has-changes }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Check for recent changes
|
||||
id: check-changes
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "has-changes=true" >> $GITHUB_OUTPUT
|
||||
echo "Manual trigger, skipping change check"
|
||||
elif git log --since='24 hours ago' --oneline | grep -q .; then
|
||||
echo "has-changes=true" >> $GITHUB_OUTPUT
|
||||
echo "Changes found in the last 24 hours"
|
||||
else
|
||||
echo "has-changes=false" >> $GITHUB_OUTPUT
|
||||
echo "No changes in the last 24 hours, skipping build"
|
||||
fi
|
||||
- uses: benjlevesque/short-sha@v2.1
|
||||
if: steps.check-changes.outputs.has-changes == 'true'
|
||||
id: short-sha
|
||||
with:
|
||||
length: 6
|
||||
|
||||
handle-firmwares:
|
||||
needs: prepare
|
||||
if: needs.prepare.outputs.has-changes == 'true'
|
||||
name: Build and deploy development firmwares artefacts
|
||||
uses: ./.github/workflows/task-build.yml
|
||||
with:
|
||||
@@ -29,6 +47,7 @@ jobs:
|
||||
|
||||
handle-documentation:
|
||||
needs: [prepare, handle-firmwares]
|
||||
if: needs.prepare.outputs.has-changes == 'true'
|
||||
name: Build and deploy development documentation
|
||||
uses: ./.github/workflows/task-docs.yml
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user