-
-
Notifications
You must be signed in to change notification settings - Fork 165
101 lines (95 loc) · 3.08 KB
/
deploy-firmware.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
# Build & Deploy the ESPHome firmwares for the Home Assistant Glow project.
name: Deploy firmware
on:
release:
types:
- published
workflow_dispatch:
inputs:
release-url:
description: "Release URL"
required: true
type: string
jobs:
build-firmware:
uses: klaasnicolaas/home-assistant-glow/.github/workflows/build-firmware.yaml@main
name: Firmware
with:
release-url: ${{ github.event.release.html_url || inputs.release-url }}
combined-manifests:
name: Combine ${{ matrix.project }} manifests
runs-on: ubuntu-latest
needs: build-firmware
strategy:
fail-fast: false
matrix:
include:
- project: home-assistant-glow
name: Home Assistant Glow
steps:
- name: ⤵️ Download specific artifacts
uses: actions/download-artifact@v4.1.8
with:
pattern: build-${{ matrix.project }}-*
merge-multiple: true
path: files
- name: 🔨 Generate device manifest.json
run: |
version=$(cat files/*/project_version | sort -V | tail -n 1)
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' files/*/manifest.json > files/manifest.json
- name: 🧪 Display structure of job
run: ls -R
- name: ⬆️ Upload project artifact
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ matrix.project }}
path: files
retention-days: 1
build-docs:
name: Build documentation
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
needs: combined-manifests
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.2.2
- name: ⬇️ Download all artifacts
uses: actions/download-artifact@v4.1.8
with:
pattern: "!build-*"
path: output
- name: 🗂️ Move firmware folders to static
run: mv output/* docs/static
- name: 🧪 Display structure of job
run: ls -R
- name: 🏗️ Set up Node.js
uses: actions/setup-node@v4.1.0
with:
node-version: 20.x
- name: 🏗️ Install Docusaurus dependencies
run: npm install --frozen-lockfile --non-interactive
working-directory: docs
- name: 🚀 Build Docusaurus
run: npm run build
working-directory: docs
- name: ⬆️ Upload pages artifacts
uses: actions/upload-pages-artifact@v3.0.1
with:
path: docs/build
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 🏗️ Setup Github Pages
uses: actions/configure-pages@v5.0.0
- name: 🚀 Deploy to Github Pages
uses: actions/deploy-pages@v4.0.5
id: deployment