Repository navigation
62 lines (58 loc) · 2.19 KB
/
Copy pathpages.yml
File metadata and controls
62 lines (58 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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