Skip to content

Commit

Permalink
Merge pull request #28 from ApolloAutomation/OldAction
Browse files Browse the repository at this point in the history
Use Action From TEMP-1
  • Loading branch information
TrevorSchirmer authored Feb 21, 2025
2 parents 74d7652 + 2f2cdd3 commit 13e7c74
Showing 1 changed file with 21 additions and 38 deletions.
59 changes: 21 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Publish

on:
push:
branches:
Expand All @@ -13,46 +12,31 @@ on:
types: [published]

jobs:
build-all-firmware:
name: Build And Release (All)
runs-on: ubuntu-latest

# We create a matrix of 4 "config" entries to build each firmware
strategy:
matrix:
config:
- name: firmware
files: Integrations/ESPHome/MSR-2_Factory.yaml
steps:
- uses: actions/checkout@v4

# Each matrix iteration calls the same ESPHome build workflow
- name: Build firmware for ${{ matrix.config.name }}
id: build
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: ${{ matrix.config.files }}
esphome-version: stable
combined-name: ${{ matrix.config.name }}
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-firmware:
name: Build And Release
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: |
Integrations/ESPHome/MSR-2_Factory.yaml
esphome-version: stable
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: Checkout source code
uses: actions/checkout@v4
uses: actions/checkout@v4.1.7
- name: Build
uses: actions/[email protected]
with:
source: ./static
destination: ./output
- name: Upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: site
path: output
Expand All @@ -61,7 +45,7 @@ jobs:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
needs:
- build-all-firmware
- build-firmware
- build-site
permissions:
pages: write
Expand All @@ -70,30 +54,29 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Download each firmware artifact by its "combined-name" (matrix.config.name)
- uses: actions/download-artifact@v4
- uses: actions/[email protected]
with:
name: firmware
path: firmware

- name: Copy firmware and manifest
run: |-
mkdir -p output/firmware
cp -r firmware/${{ needs.build-all-firmware.outputs.version }}/* output/firmware/
cp -r firmware/${{ needs.build-firmware.outputs.version }}/* output/firmware/
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v4.1.8
with:
name: site
path: output

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

- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@v5.0.0

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4.0.5

0 comments on commit 13e7c74

Please sign in to comment.