fixes for website #391
This file contains hidden or 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
| name: Build | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| # Build the ESPHome firmwares for the S0tool project. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| name: 🏗️ Build firmware 🛠️ | |
| uses: esphome/workflows/.github/workflows/build.yml@main | |
| with: | |
| files: | | |
| esphome/watermeter.yaml | |
| esphome/pulscounter.yaml | |
| esphome/S0-puls-kwhpuls.yaml | |
| esphome/S0-puls-DSZ12D.yaml | |
| esphome/S0-puls-LEM022SJ.yaml | |
| esphome/s0-watermeter.yaml | |
| esphome/wsz15d32a.yaml | |
| esphome/sdm72d.yaml | |
| esphome/puls-water-internal.yaml | |
| esphome/kwh-water-test.yaml | |
| esphome/pulscounter_flux.yaml | |
| esphome-version: 2025.7.0 | |
| release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }} | |
| release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }} | |
| release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }} | |
| consolidate: | |
| name: Consolidate firmwares 🚀 | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/[email protected] | |
| - name: Download built firmwares | |
| uses: actions/[email protected] | |
| with: | |
| path: firmwares | |
| - name: Remove intermediate version folder | |
| run: |- | |
| for d in firmwares/*/*; do | |
| if [ -d "$d" ]; then | |
| mv $d/* $d/../ | |
| rm -rf $d | |
| fi | |
| done | |
| - name: Copy files | |
| run: |- | |
| mkdir output | |
| cp -R static/* output/ | |
| cp -R firmwares/* output/ | |
| - name: Copy manifest files to root and modify paths # This is required so that older firmwares can update to newer firmwares with new manifest paths | |
| run: |- | |
| for device in firmwares/*; do | |
| device=$(basename $device) | |
| jq --arg device "$device" \ | |
| '.builds[].ota.path |= $device + "/" + . | (.builds[].parts // [])[].path |= $device + "/" + .' \ | |
| firmwares/$device/manifest.json > output/$device-manifest.json | |
| done | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/[email protected] | |
| with: | |
| path: output | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| name: 🏗️ Deploy to GitHub Pages 🚀 | |
| runs-on: ubuntu-latest | |
| needs: consolidate | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/[email protected] | |
| - name: 🏗️ Setup website pages | |
| uses: actions/[email protected] | |
| - name: 🏗️ Deploy Firmware to GitHub Pages | |
| id: deployment | |
| uses: actions/[email protected] |