Rev 2 of PCB design #48
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: Generate KiCad Images | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
images: | |
name: Generate Images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup APT repositories | |
run: | | |
sudo add-apt-repository --yes ppa:kicad/kicad-9.0-releases | |
sudo apt update | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: kicad kicad-demos kicad-doc-en kicad-footprints kicad-libraries kicad-packages3d kicad-symbols poppler-utils | |
version: 1.0 | |
execute_install_scripts: true | |
- name: Attempt to fix install issues | |
run: | | |
sudo apt install -y --no-install-recommends kicad-packages3d | |
- name: Generate Images | |
run: | | |
rm images/* || true | |
kicad-cli pcb render --output=images/pcbf.png --side=top tuxkeychain.kicad_pcb | |
kicad-cli pcb render --output=images/pcbb.png --side=bottom tuxkeychain.kicad_pcb | |
kicad-cli sch export pdf --output=/tmp/schematic.pdf tuxkeychain.kicad_sch | |
# convert schematic to png with poppler | |
pdftoppm -png /tmp/schematic.pdf > images/schematic.png | |
- name: Commit and push images | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git add images/* | |
git commit -m "Add generated images" | |
git push |