-
Notifications
You must be signed in to change notification settings - Fork 104
86 lines (80 loc) · 2.65 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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: v2board_esp8266_d1_mini_lite.yaml
name: V2 Board ESP8266 D1 Mini Lite
manifest_filename: v2board_esp8266_d1_mini_lite-manifest.json
- file: v2board_esp32_d1_mini.yaml
name: V2 Board ESP32 D1 Mini
manifest_filename: v2board_esp32_d1_mini-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 }}", "new_install_improv_wait_time": 15, "new_install_prompt_erase": true, "version": "${{ steps.esphome-build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_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]