-
Notifications
You must be signed in to change notification settings - Fork 36
83 lines (68 loc) · 2.26 KB
/
launchpad.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build and deploy to Launchpad
# Trigger the workflow on push to master branch or manually from the Actions tab
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: espressif/idf:v5.4
steps:
- uses: actions/checkout@v4
# Install external dependencies
- name: Install dependencies
run: |
apt-get update
apt-get install -y tree
# Build the application using ESP-IDF, merge the binaries and save as esp-prog2.bin
- name: Build application
run: |
. $IDF_PATH/export.sh
export SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp_prog2;sdkconfig.defaults.esp32s3"
idf.py build
mkdir -p binaries
idf.py merge-bin -o esp-prog2.bin
# Create page files for deployment
# Copy the built binaries and the launchpad.toml file to the binaries directory
# and generate an index.html file with the file tree of the binaries directory.
- name: Create page files
run: |
cp build/esp-prog2.bin binaries/
cp launchpad.toml binaries/
cd binaries
tree -q -H '.' -L 1 -T 'esp-usb-bridge Launchpad Artifacts' -shi --charset utf-8 -I "index.html" -o index.html
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: binaries
path: binaries/
# Job to deploy the application to GitHub Pages
deploy:
needs: build
# Necessary permissions to deploy to GitHub Pages
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Download the built binaries artifact
- name: Download built files
uses: actions/download-artifact@v4
with:
name: binaries
path: binaries/
- name: Setup GitHub Pages
uses: actions/configure-pages@v4
- name: Upload built files to GitHub pages
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: binaries/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4