forked from jniebuhr/gaggimate
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (68 loc) · 2.23 KB
/
Copy pathpr-flash.yml
File metadata and controls
69 lines (68 loc) · 2.23 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
63
64
65
66
67
68
69
name: Deploy PR Preview
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
deploy:
runs-on: ubuntu-latest
# Only run for PRs opened by the repo owner; fork PRs get a read-only
# GITHUB_TOKEN and can't publish to gh-pages.
if: github.event.pull_request.user.login == github.repository_owner
permissions:
contents: write
pages: write
pull-requests: write
continue-on-error: true
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-tags: true
fetch-depth: 0
submodules: 'recursive'
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Add version
run: |
mkdir -p out
git tag -d nightly
git describe --tags --dirty > out/version.txt
- name: Build Web
run: ./scripts/build_webui.sh
- name: Build controller
run: |
pio run -e controller
mv .pio/build/controller/firmware.bin out/board-firmware.bin
mv .pio/build/controller/partitions.bin out/board-partitions.bin
mv .pio/build/controller/bootloader.bin out/board-bootloader.bin
- name: Build display
run: |
pio run -e display
mv .pio/build/display/firmware.bin out/display-firmware.bin
mv .pio/build/display/partitions.bin out/display-partitions.bin
mv .pio/build/display/bootloader.bin out/display-bootloader.bin
- name: Build display FS
run: |
pio run -t buildfs -e display
cp .pio/build/display/littlefs.bin out/display-filesystem.bin
- name: Deploy to GitHub Pages subdirectory
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
destination_dir: pr-${{ github.event.pull_request.number }}
publish_branch: gh-pages