1+ name : Build binaries, docs and publish to dev folder
2+
3+ on :
4+ workflow_dispatch :
5+ schedule :
6+ - cron : " 0 0 * * *"
7+
8+ jobs :
9+ prepare :
10+ runs-on : ubuntu-latest
11+ if : github.repository_owner == '1technophile'
12+ outputs :
13+ short-sha : ${{ steps.short-sha.outputs.sha }}
14+ has-changes : ${{ steps.check-changes.outputs.has-changes }}
15+ steps :
16+ - uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+ - name : Check for recent changes
20+ id : check-changes
21+ run : |
22+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
23+ echo "has-changes=true" >> $GITHUB_OUTPUT
24+ echo "Manual trigger, skipping change check"
25+ elif git log --since='24 hours ago' --oneline | grep -q .; then
26+ echo "has-changes=true" >> $GITHUB_OUTPUT
27+ echo "Changes found in the last 24 hours"
28+ else
29+ echo "has-changes=false" >> $GITHUB_OUTPUT
30+ echo "No changes in the last 24 hours, skipping build"
31+ fi
32+ - uses : benjlevesque/short-sha@v2.1
33+ if : steps.check-changes.outputs.has-changes == 'true'
34+ id : short-sha
35+ with :
36+ length : 6
37+
38+ handle-firmwares :
39+ needs : prepare
40+ if : needs.prepare.outputs.has-changes == 'true'
41+ name : Build and deploy development firmwares artefacts
42+ uses : ./.github/workflows/task-build.yml
43+ with :
44+ enable-dev-ota : true
45+ version-tag : ${{ needs.prepare.outputs.short-sha }}
46+ artifact-retention-days : 1
47+
48+ handle-documentation :
49+ needs : [prepare, handle-firmwares]
50+ if : needs.prepare.outputs.has-changes == 'true'
51+ name : Build and deploy development documentation
52+ uses : ./.github/workflows/task-docs.yml
53+ with :
54+ mode : " dev"
55+ version : ${{ needs.prepare.outputs.short-sha }}
56+ url-prefix : " /dev/"
57+ destination-dir : " dev"
58+ run-pagespeed : true
59+ pagespeed-url : ' https://docs.openmqttgateway.com/dev/'
60+ secrets :
61+ github-token : ${{ secrets.GITHUB_TOKEN }}
62+ pagespeed-apikey : ${{ secrets.APIKEY }}
0 commit comments