Refactor deployment workflow so it no longer needs two jobs #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Web Installer to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/pip | |
| ~/.platformio/.cache | |
| key: ${{ runner.os }}-pio | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install PlatformIO Core | |
| run: pip install --upgrade platformio | |
| - name: Build and merge V1.0.0 | |
| working-directory: ./Firmware | |
| run: pio run -e Auckland_Rail_Network_V1_0_0 --target mergebin | |
| - name: Build and merge V1.1.0 | |
| working-directory: ./Firmware | |
| run: pio run -e Auckland_Rail_Network_V1_1_0 --target mergebin | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Prepare deployment files | |
| run: | | |
| mkdir -p _site/bin/Auckland-LED-Rail-Map-V1.0.0 | |
| mkdir -p _site/bin/Auckland-LED-Rail-Map-V1.1.0 | |
| cp -r "Web Installer/bin/Auckland-LED-Rail-Map-V1.0.0/." _site/bin/Auckland-LED-Rail-Map-V1.0.0/ | |
| cp -r "Web Installer/bin/Auckland-LED-Rail-Map-V1.1.0/." _site/bin/Auckland-LED-Rail-Map-V1.1.0/ | |
| cp "Web Installer/led-rails.html" _site/ | |
| cp "Web Installer/favicon.png" _site/ | |
| cp Firmware/.pio/build/Auckland_Rail_Network_V1_0_0/firmware-merged.bin _site/bin/Auckland-LED-Rail-Map-V1.0.0/firmware-merged-100.bin | |
| cp Firmware/.pio/build/Auckland_Rail_Network_V1_1_0/firmware-merged.bin _site/bin/Auckland-LED-Rail-Map-V1.1.0/firmware-merged-110.bin | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "_site" | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |