-
-
Notifications
You must be signed in to change notification settings - Fork 21
113 lines (108 loc) · 3.22 KB
/
deploy.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
102
103
104
105
106
107
108
109
110
111
112
113
---
name: Deploy
on:
# push:
# branches:
# - main
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "The version of the firmware to build"
required: true
type: string
release-url:
description: "Release URL"
required: true
type: string
jobs:
build-firmware:
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: |
esphome/onju-voice.yaml
esphome/onju-voice-microwakeword.yaml
esphome-version: latest
release-summary: "Check the release notes for more information."
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || (github.event_name == 'workflow_dispatch' && inputs.release-url) || '' }}
release-version: ${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}
build-docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗️ Set up Node.js
uses: actions/[email protected]
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 documentation artifact
uses: actions/[email protected]
with:
name: site
path: docs/build
consolidate:
name: Consolidate
runs-on: ubuntu-latest
needs:
- build-firmware
- build-docs
steps:
- name: ⬇️ Download documentation artifact
uses: actions/[email protected]
with:
name: site
path: site
- name: ⬇️ Download firmware artifacts
uses: actions/[email protected]
with:
pattern: onju-voice*
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: 🗂️ Move firmware files to docs
run: |
mkdir output
cp -R site/* output/
cp -R firmwares output/firmware/
# - name: 🧪 Display firmware artifacts
# run: ls -lR
- name: 🧹 Remove documentation artifact
uses: geekyeggo/[email protected]
with:
name: site
- name: ⬆️ Upload pages artifacts
uses: actions/[email protected]
with:
path: output
deploy:
name: Deploy
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 Github Pages
uses: actions/[email protected]
- name: 🚀 Deploy to Github Pages
uses: actions/[email protected]
id: deployment