-
Notifications
You must be signed in to change notification settings - Fork 588
77 lines (75 loc) · 2.64 KB
/
build.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
name: Jekyll site CI
on:
push:
branches:
- main
schedule:
- cron: 0 10 * * *
pull_request:
workflow_dispatch:
jobs:
check-repo-owner:
# This job is so the entire workflow will end successfully and give some
# output to explain why it hasn't run on a non-Adafruit fork.
runs-on: ubuntu-latest
steps:
- name: repository
env:
OWNER_IS_ADAFRUIT: ${{ startswith(github.repository, 'adafruit/') }}
run: |
echo "This workflow will only run if Adafruit is the repository owner."
echo "Repository owner is Adafruit: $OWNER_IS_ADAFRUIT"
build:
runs-on: ubuntu-latest
# Only run the build on Adafruit's repository. Forks won't have the secrets.
# Its necessary to do this here, since 'schedule' events cannot (currently)
# be limited (they run on all forks' default branches).
if: startswith(github.repository, 'adafruit/')
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Update Awesome CircuitPython
run: |
(cd awesome-circuitpython && git fetch origin main:main && git checkout main)
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3'
bundler-cache: true
- name: Install Dependencies
run: |
gem install bundler:1.17.3
bundle install --full-index
pip install python-frontmatter pillow python-dateutil
- name: Check feature names and other data
run: python3 check-boards.py
- name: Check Image Dimensions
run: python3 check-images.py
- name: Make Directory For Report Files
run: mkdir -p json
- name: Generate ESP32 Boards JSON
run: python3 generate-board-info.py -o json/esp32_boards.json
- name: Check For Files
run: |
ls json
- name: Upload ESP32 Boards JSON To AWS S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp json/esp32_boards.json s3://adafruit-circuit-python/esp32_boards.json --no-progress --region us-east-1"
- name: Build site with jekyll
run: |
bundle exec jekyll build -d build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
cname: circuitpython.org
user_name: ${{ secrets.ADABOT_GITHUB_USER }}
user_email: ${{ secrets.ADABOT_GITHUB_EMAIL }}
if: github.event_name != 'pull_request'