NPR70/.github/workflows/main.yml
2025-12-31 12:23:22 +01:00

100 lines
2.5 KiB
YAML

name: CI
on:
push:
branches: [ master ]
jobs:
build-web:
runs-on: ubuntu-latest
container:
image: ghcr.io/slintak/kicad-builder:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Everything
run: make
- name: Upload Fabrication Files
uses: actions/upload-artifact@v4
with:
name: build-fabrication
path: build/web/files/
if-no-files-found: error
- name: Upload Web Files
uses: actions/upload-artifact@v4
with:
name: build-web
path: build/web/
if-no-files-found: error
build-fw:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup arm-none-eabi-gcc
uses: carlosperate/arm-none-eabi-gcc-action@v1
- name: Build
working-directory: src
run: make
- name: Upload firmware artifacts
uses: actions/upload-artifact@v4
with:
name: build-fw
path: |
src/BUILD/NPR70.bin
src/BUILD/NPR70.hex
src/BUILD/NPR70.elf
if-no-files-found: error
# Deploy job
deploy:
# Add a dependency to the build job
needs: [build-web, build-fw]
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Get Web Files
uses: actions/download-artifact@v4
with:
name: build-web
path: build/
- name: Get Firmware Files
uses: actions/download-artifact@v4
with:
name: build-fw
path: fw/
- name: Bundle firmware ZIP into site files
shell: bash
run: |
mkdir -p build/files
zip -j "build/files/npr70-fw-${GITHUB_SHA::7}.zip" \
fw/NPR70.bin fw/NPR70.hex fw/NPR70.elf
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4