Repository navigation
Deploy flasher to GitHub Pages #10
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 flasher to GitHub Pages | |
| # Publishes ONLY the flash/ folder (the ESP Web Tools install page + manifest) | |
| # as the site root, so the flasher is fast to deploy and the whole 90 MB repo | |
| # isn't packaged into the Pages artifact. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "flash/**" | |
| - ".github/workflows/pages.yml" | |
| # Re-deploy whenever a new release is published, so the flasher serves the | |
| # latest firmware bins (they're fetched from the release at build time). | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| # The github-pages environment only allows deployments from the default | |
| # branch. A release published from a feature branch runs from its tag ref | |
| # and would be rejected at the environment gate (a hard failure). So for | |
| # release events, only deploy when the release was cut from the default | |
| # branch (the normal flow); otherwise skip cleanly. You can still update the | |
| # flasher for a branch-cut release via workflow_dispatch from main. | |
| if: >- | |
| github.event_name != 'release' || | |
| github.event.release.target_commitish == github.event.repository.default_branch | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Pull the latest release's factory images into flash/ so the flasher | |
| # serves them same-origin. GitHub release downloads send no CORS headers, | |
| # so ESP Web Tools can't fetch them cross-origin from the Pages site. | |
| - name: Fetch firmware binaries from the latest release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release download --repo "${{ github.repository }}" \ | |
| --pattern 'Ropener-VAL3000.factory.bin' \ | |
| --pattern 'Ropener-VAL3100.factory.bin' \ | |
| --dir flash --clobber | |
| - uses: actions/configure-pages@v5 | |
| with: | |
| enablement: true | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: flash | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |