Skip to content

Commit

Permalink
better auto-img and upload to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
H3wastooshort committed May 5, 2024
1 parent e67d035 commit cccf0db
Showing 1 changed file with 62 additions and 35 deletions.
97 changes: 62 additions & 35 deletions .github/workflows/kicad_hardware_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ on:
# - 'hardware/BikeUSBv2.kicad_pcb'

jobs:
setupGHP:
steps:
name: setupGHP
runs-on: ubuntu-latest
- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v3


# ERC:
# runs-on: ubuntu-latest
# container: ghcr.io/inti-cmnb/kicad7_auto
Expand All @@ -31,6 +40,7 @@ jobs:
# name: ERC
# path: Fabrication


# DRC:
# runs-on: ubuntu-latest
# container: ghcr.io/inti-cmnb/kicad7_auto
Expand All @@ -49,30 +59,13 @@ jobs:
# name: DRC
# path: Fabrication

# FabSch:
# name: Schematic fabrication files
# runs-on: ubuntu-latest
# container: ghcr.io/inti-cmnb/kicad7_auto
# needs: ERC
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Run schematic stuff
# run: |
# [ -f hardware/*.kicad_sch ] && kiplot -d Fabrication -s print_sch

# - name: Retrieve results
# uses: actions/upload-artifact@v4
# with:
# name: FabSch
# path: Fabrication
# TODO: iBOM generation

# FabPCB:
# name: PCB fabrication files
# runs-on: ubuntu-latest
# container: ghcr.io/inti-cmnb/kicad7_auto
# needs: DRC
# needs: setupGHP # DRC
#
# steps:
# - uses: actions/checkout@v4
Expand All @@ -86,12 +79,19 @@ jobs:
# with:
# name: FabPCB
# path: Fabrication
# - name: Upload Artifact
# if: github.ref == 'refs/heads/main'
# uses: actions/upload-pages-artifact@v1
# with:
# name: FabPCB
# path: "Fabrication"


DocSch:
name: Schematic for documentation
runs-on: ubuntu-latest
container: ghcr.io/inti-cmnb/kicad7_auto
# needs: ERC
needs: setupGHP #ERC

steps:
- uses: actions/checkout@v4
Expand All @@ -105,22 +105,49 @@ jobs:
with:
name: DocSch
path: BikeUSBv2.svg
- name: Upload Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v1
with:
name: DocSch.svg
path: "BikeUSBv2.svg"

# DocPCB:
# name: PCB renders for Documentation
# runs-on: ubuntu-latest
# container: ghcr.io/inti-cmnb/kicad7_auto
# needs: DRC

# steps:
# - uses: actions/checkout@v4
DocPCB:
name: DocPCB
runs-on: ubuntu-latest
needs: setupGHP
steps:
- name: Check out the repo
uses: actions/checkout@v4

# - name: Run PCB stuff
# run: |
# kicad-cli pcb render --output Renders hardware/BikeUSBv2.kicad_sch
- name: render pcb image
uses: linalinn/kicad-render@main
with:
pcb_file: hardware/BikeUSBv2.kicad_pcb
output_path: ${{ github.workspace }}/images

# - name: Retrieve results
# uses: actions/upload-artifact@v4
# with:
# name: DocRenders
# path: Renders
- name: Upload Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v1
with:
path: "images"


deploy-pages:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: setupGHP DocPCB DocSch # FabPCB FabBOM

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit cccf0db

Please sign in to comment.