|
1 | | -name: Publish |
| 1 | +name: Build and Publish |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - main |
6 | 7 | workflow_dispatch: |
7 | 8 | inputs: |
8 | | - version: |
9 | | - description: 'The version of the firmware to build' |
10 | | - required: true |
11 | | - release: |
12 | | - types: [published] |
| 9 | + bypass-yaml-check: |
| 10 | + description: 'Bypass YAML change check (force build/publish)' |
| 11 | + type: boolean |
| 12 | + required: false |
| 13 | + default: false |
| 14 | + # release: |
| 15 | + # types: [published] |
13 | 16 |
|
14 | 17 | jobs: |
15 | | - build-firmware: |
16 | | - name: Build And Release |
17 | | - uses: esphome/workflows/.github/workflows/build.yml@main |
18 | | - with: |
19 | | - files: | |
20 | | - Integrations/ESPHome/MSR-2_Factory.yaml |
21 | | - esphome-version: stable |
22 | | - combined-name: firmware |
23 | | - release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }} |
24 | | - release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }} |
25 | | - release-version: ${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }} |
26 | | - |
27 | | - build-site: |
28 | | - name: Build Site |
29 | | - runs-on: ubuntu-latest |
30 | | - steps: |
31 | | - - name: Checkout source code |
32 | | - uses: actions/checkout@v4.1.7 |
33 | | - - name: Build |
34 | | - uses: actions/jekyll-build-pages@v1.0.13 |
35 | | - with: |
36 | | - source: ./static |
37 | | - destination: ./output |
38 | | - - name: Upload |
39 | | - uses: actions/upload-artifact@v4.3.6 |
40 | | - with: |
41 | | - name: site |
42 | | - path: output |
43 | | - |
44 | | - publish: |
45 | | - name: Publish to GitHub Pages |
46 | | - runs-on: ubuntu-latest |
47 | | - needs: |
48 | | - - build-firmware |
49 | | - - build-site |
| 18 | + build-and-publish: |
| 19 | + uses: ApolloAutomation/Workflows/.github/workflows/build.yml@main |
50 | 20 | permissions: |
| 21 | + contents: write |
51 | 22 | pages: write |
52 | 23 | id-token: write |
53 | | - environment: |
54 | | - name: github-pages |
55 | | - url: ${{ steps.deployment.outputs.page_url }} |
56 | | - steps: |
57 | | - - uses: actions/download-artifact@v4.1.8 |
58 | | - with: |
59 | | - name: firmware |
60 | | - path: firmware |
61 | | - |
62 | | - - name: Copy firmware and manifest |
63 | | - run: |- |
64 | | - mkdir -p output/firmware |
65 | | - cp -r firmware/${{ needs.build-firmware.outputs.version }}/* output/firmware/ |
66 | | -
|
67 | | - - uses: actions/download-artifact@v4.1.8 |
68 | | - with: |
69 | | - name: site |
70 | | - path: output |
71 | | - |
72 | | - - uses: actions/upload-pages-artifact@v3.0.1 |
73 | | - with: |
74 | | - path: output |
75 | | - retention-days: 1 |
76 | | - |
77 | | - - name: Setup Pages |
78 | | - uses: actions/configure-pages@v5.0.0 |
79 | | - |
80 | | - - name: Deploy to GitHub Pages |
81 | | - id: deployment |
82 | | - uses: actions/deploy-pages@v4.0.5 |
| 24 | + pull-requests: write |
| 25 | + with: |
| 26 | + device-name: msr-2 |
| 27 | + yaml-files: | |
| 28 | + Integrations/ESPHome/MSR-2_Factory.yaml |
| 29 | + firmware-names: "_Factory:firmware" |
| 30 | + core-yaml-path: Integrations/ESPHome/Core.yaml |
| 31 | + esphome-version: stable |
| 32 | + # Bypass check if manually triggered with bypass option |
| 33 | + check-yaml-changes: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.bypass-yaml-check == 'true') }} |
| 34 | + publish-to-pages: true |
| 35 | + has-installer: true |
| 36 | + installer-path: static |
0 commit comments