.github/workflows/build.yml #70
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
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: '0 4 * * 1' | |
jobs: | |
build: | |
name: Build ${{ matrix.firmware.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
firmware: | |
- file: m5stack-atom-lite.yaml | |
name: M5Stack Atom Lite | |
manifest_filename: m5stack-atom-lite-manifest.json | |
- file: esp32-generic.yaml | |
name: ESP32 Generic | |
manifest_filename: esp32-generic-manifest.json | |
- file: olimex-esp32-poe-iso.yaml | |
name: Olimex PoE ISO | |
manifest_filename: olimex-esp32-poe-iso-manifest.json | |
- file: wt32-eth01.yaml | |
name: Wireless-Tag WT32-ETH01 | |
manifest_filename: wt32-eth01-manifest.json | |
- file: gl-s10.yaml | |
name: GL.iNet GL-S10 | |
manifest_filename: gl-s10-manifest.json | |
- file: lilygo-t-eth-poe.yaml | |
name: LilyGO T-ETH-POE | |
manifest_filename: lilygo-t-eth-poe-manifest.json | |
fail-fast: false | |
steps: | |
- name: Checkout source code | |
uses: actions/[email protected] | |
- name: Build firmware | |
uses: esphome/[email protected] | |
id: esphome-build | |
with: | |
yaml_file: ${{ matrix.firmware.file }} | |
version: latest | |
- name: Copy firmware and manifest | |
run: | | |
mkdir output | |
mv ${{ steps.esphome-build.outputs.name }} output/ | |
jq -s '{"name": "${{ matrix.firmware.name }}", "version": "${{ steps.esphome-build.outputs.version }}", "home_assistant_domain": "esphome", "new_install_prompt_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }} | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: ${{ matrix.firmware.name }} | |
path: output | |
consolidate: | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
name: Consolidate firmwares | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Download built firmwares | |
uses: actions/download-artifact@v3 | |
with: | |
path: firmwares | |
- name: Copy files | |
run: |- | |
mkdir output | |
cp -R static/* output/ | |
cp -R firmwares/*/* output/ | |
- name: Upload GitHub Pages artifact | |
uses: actions/[email protected] | |
with: | |
path: output | |
deploy: | |
if: github.event_name != 'pull_request' && 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: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/[email protected] |