Skip to content

Commit

Permalink
Try a different way to combine site and firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz committed Aug 19, 2024
1 parent 0d85895 commit 39f1952
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
types: [published]

jobs:
build:
build-firmware:
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@main
with:
Expand All @@ -22,37 +22,54 @@ jobs:
project-template-esp32-c3.factory.yaml
project-template-esp32-s3.factory.yaml
esphome-version: 2024.7.3
combined-name: project-template
combined-name: firmware
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) || '' }}

build-site:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Build
uses: actions/[email protected]
with:
source: ./static
destination: ./output
- name: Upload
uses: actions/[email protected]
with:
name: site
path: output

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]
needs:
- build-firmware
- build-site
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:
name: project-template
path: files

- name: Build
uses: actions/[email protected]
with:
source: ./static
destination: ./output
name: firmware
path: firmware

- name: Copy firmware and manifest
run: cp -r files/${{ needs.build.outputs.version }}/* output/
run: |-
mkdir -p output/firmware
cp -r firmware/${{ needs.build-firmware.outputs.version }}/* output/firmware/
- uses: actions/[email protected]
with:
name: site
path: output

- uses: actions/[email protected]
with:
Expand Down

0 comments on commit 39f1952

Please sign in to comment.