-
Notifications
You must be signed in to change notification settings - Fork 15
66 lines (58 loc) · 1.91 KB
/
publish.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
name: Publish
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: 'The version of the firmware to build'
required: true
release:
types: [published]
jobs:
build:
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: |
project-template-esp32.factory.yaml
project-template-esp32-c3.factory.yaml
project-template-esp32-s3.factory.yaml
esphome-version: 2024.7.3
combined-name: project-template
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) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}
publish:
name: Publish to GitHub Pages
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
needs: [build]
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: files
- name: Build
uses: actions/[email protected]
with:
source: ./static
destination: ./output
- name: Copy firmware and manifest
run: cp -r files/${{ needs.build.outputs.version }}/* output/
- uses: actions/[email protected]
with:
path: output
retention-days: 1
- name: Setup Pages
uses: actions/[email protected]
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]