experiment with kibot workflow #11
This file contains 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 files | |
# Runs on changes to the hardware directory | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'hardware/**' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'hardware/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Cache KiCad 8.0 | |
uses: actions/cache@v4 | |
with: | |
key: kicad-8.0-ubuntu | |
path: /opt/KiCad | |
- name: Setup KiCad 8.0 | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-for-kicad/setup-kicad@v1.0 | |
with: | |
version: '8.0' | |
- name: Generate side panel schematic pdf | |
uses: actions-for-kicad/generate-kicad-files@v1.0 | |
with: | |
file: ${{ github.workspace }}/hardware/module/side_panel/side_panel.kicad_sch | |
type: schematic_pdf | |
- name: Generate top connector schematic pdf | |
uses: actions-for-kicad/generate-kicad-files@v1.0 | |
with: | |
file: ${{ github.workspace }}/hardware/top_connector/top_connector.kicad_sch | |
type: schematic_pdf | |
- name: Commit and Push changes | |
run: | | |
mv ${{ github.workspace }}/side_panel.pdf ${{ github.workspace }}/hardware/module/side_panel/side_panel.pdf | |
git add ${{ github.workspace }}/hardware/module/side_panel/side_panel.pdf | |
mv ${{ github.workspace }}/top_connector.pdf ${{ github.workspace }}/hardware/top_connector/top_connector.pdf | |
git add ${{ github.workspace }}/hardware/top_connector/top_connector.pdf | |
git commit -m "Workflow: Generate KiCad files" | |
git push origin HEAD:${{ github.head_ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |