name: Device pages # Regenerates public/devices/status.json (which src/pages/devices.astro renders) # and the wiki device pages from peacock-ports status.toml, converting each device # package's image.* to webp. See peacock-ports/device/STATUS.md. on: workflow_dispatch: repository_dispatch: types: [devices-update] # fired by peacock-ports on status.toml / image change schedule: - cron: '17 6 * * *' # daily safety net push: branches: [master] paths: - 'scripts/gen-devices.py' - '.github/workflows/devices.yml' permissions: contents: write # commit the regenerated device data concurrency: group: device-pages cancel-in-progress: false jobs: generate: runs-on: ubuntu-latest steps: - name: Checkout site uses: actions/checkout@v4 - name: Checkout peacock-ports uses: actions/checkout@v4 with: repository: PeacockProject/peacock-ports path: .peacock-ports - name: Install webp tooling run: sudo apt-get update && sudo apt-get install -y --no-install-recommends webp imagemagick - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Generate device data + push wiki env: PEACOCK_PORTS: ${{ github.workspace }}/.peacock-ports PEACOCK_SITE: ${{ github.workspace }} WIKI_URL: https://wiki.peacockos.org WIKI_API_TOKEN: ${{ secrets.WIKI_API_TOKEN }} run: python3 scripts/gen-devices.py - name: Commit regenerated device data run: | git config user.name 'peacock-bot' git config user.email 'bot@peacockos.org' git add public/devices/ if git diff --cached --quiet; then echo 'No device changes to commit.' else git commit -m 'ci: regenerate device data from status.toml' git push fi