66 lines
2.0 KiB
YAML
Raw Normal View History

2024-10-31 14:43:34 +05:30
name: Build and publish RaspAP images
permissions:
contents: write
on:
2025-02-08 11:37:25 +01:00
workflow_dispatch:
2024-10-31 14:43:34 +05:30
release:
types: [published]
jobs:
build-raspap-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: "32-bit"
pi_gen_version: "master"
- arch: "64-bit"
pi_gen_version: "arm64"
fail-fast: false
2024-10-31 14:43:34 +05:30
steps:
- name: Checkout repository
uses: actions/checkout@v4
2024-11-04 22:05:02 +05:30
- name: Add RaspAP Stage
2024-10-31 18:20:25 +05:30
run: |
2024-11-04 22:05:02 +05:30
mkdir -p stage-raspap/package-raspap &&
2024-10-31 18:20:25 +05:30
{
2024-11-04 22:05:02 +05:30
cat > stage-raspap/package-raspap/00-run-chroot.sh <<-EOF
2024-10-31 18:20:25 +05:30
#!/bin/bash
2024-11-04 22:05:02 +05:30
apt-get update -y && apt-get install -y curl dhcpcd5 iptables procps
2025-02-08 12:11:31 +01:00
curl -sL https://raw.githubusercontent.com/billz/raspap-webgui/refs/heads/master/installers/raspbian.sh | bash -s -- --yes --openvpn 1 --restapi 1 --adblock 1 --wireguard 1 --tcp-bbr 1 --check 0
2024-10-31 18:20:25 +05:30
EOF
} &&
2024-11-04 22:05:02 +05:30
chmod +x stage-raspap/package-raspap/00-run-chroot.sh &&
2024-10-31 18:20:25 +05:30
{
2024-11-04 22:05:02 +05:30
cat > stage-raspap/prerun.sh <<-EOF
2024-10-31 18:20:25 +05:30
#!/bin/bash -e
if [ ! -d "\${ROOTFS_DIR}" ]; then
copy_previous
fi
EOF
} &&
2024-11-04 22:05:02 +05:30
chmod +x stage-raspap/prerun.sh
2024-10-31 18:20:25 +05:30
2024-10-31 14:43:34 +05:30
- name: Build RaspAP Image
id: build
uses: usimd/pi-gen-action@v1
with:
image-name: "raspap-${{ github.ref_name }}-${{ matrix.arch }}"
enable-ssh: 1
2024-11-04 22:05:02 +05:30
stage-list: stage0 stage1 stage2 ./stage-raspap
2024-10-31 14:43:34 +05:30
verbose-output: true
pi-gen-version: ${{ matrix.pi_gen_version }}
2024-11-04 22:05:02 +05:30
pi-gen-repository: RaspAP/pi-gen
2024-10-31 14:43:34 +05:30
- name: Upload Artifact
uses: svenstaro/upload-release-action@v2
with:
asset_name: raspap-image-${{ github.ref_name }}-${{ matrix.arch }}.zip
file: ${{ steps.build.outputs.image-path }}
2024-10-31 14:43:34 +05:30
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
overwrite: true