Skip to content

Commit

Permalink
Initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisloge committed Dec 29, 2024
0 parents commit 9a8a140
Show file tree
Hide file tree
Showing 23 changed files with 1,758 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
pull_request:
paths:
- "*.yaml"
- ".github/workflows/ci.yml"
schedule:
- cron: "0 0 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
ci:
name: Building ${{ matrix.file }} / ${{ matrix.esphome-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
file:
- alarm-clock-esp32-s3-jc3248w535c

esphome-version:
- stable
- beta
- dev
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: ESPHome ${{ matrix.esphome-version }}
uses: esphome/[email protected]
with:
yaml-file: ${{ matrix.file }}.yaml
version: ${{ matrix.esphome-version }}
- name: ESPHome ${{ matrix.esphome-version }} Factory
uses: esphome/[email protected]
with:
yaml-file: ${{ matrix.file }}.factory.yaml
version: ${{ matrix.esphome-version }}
30 changes: 30 additions & 0 deletions .github/workflows/publish-firmware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Firmware

on:
release:
types: [published]

permissions:
contents: write

jobs:
build-firmware:
name: Build Firmware
uses: esphome/workflows/.github/workflows/[email protected]
with:
files: |
alarm-clock-esp32-s3-jc3248w535c.factory.yaml
esphome-version: 2024.12.2
combined-name: alarm-clock

release-summary: ${{ github.event.release.body }}
release-url: ${{ github.event.release.html_url }}
release-version: ${{ github.event.release.tag_name }}

upload-to-release:
name: Upload to Release
uses: esphome/workflows/.github/workflows/[email protected]
needs:
- build-firmware
with:
version: ${{ github.event.release.tag_name }}
72 changes: 72 additions & 0 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish Pages

on:
push:
branches:
- main
paths:
- 'static/**'
- '.github/workflows/publish-pages.yml'
workflow_run:
workflows:
- Publish Firmware
types:
- completed
pull_request:
paths:
- 'static/**'
- '.github/workflows/publish-pages.yml'


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4

- run: mkdir -p output/firmware

- name: Build
uses: actions/jekyll-build-pages@v1
with:
source: ./static
destination: ./output

- name: Fetch firmware files
uses: robinraju/release-downloader@v1
with:
latest: true
fileName: '*'
out-file-path: output/firmware

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: output
retention-days: 1

publish:
if: github.event_name != 'pull_request'
name: Publish
runs-on: ubuntu-latest
needs:
- build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml
/venv
Loading

0 comments on commit 9a8a140

Please sign in to comment.