Skip to content

Build pages

Build pages #35

Workflow file for this run

name: "Build pages"
on:
push:
branches:
- main
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v3
- name: 🔑 Configure GPG key
run: |
echo -n "$GPG_SIGNING_KEY" | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: 🏗 Install apt-utils
run: |
sudo apt-get -y install apt-utils
- name: 🏗 Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 📦 Cache apt-ftparchive db
uses: actions/cache@v3
with:
path: cache
key: ${{ runner.os }}-apt-ftparchive
- name: 🏗 Prepare folders
run: |
mkdir -p cache
mkdir -p public/debian
cp -ar pool public/debian
- name: ✍ Generate repository files
env:
DISTS: bullseye
COMPONENTS: rpi
ARCHS: binary-armhf
run: |
repo="public/debian/dists"
# prepare directory structure
for dist in $DISTS; do
for component in $COMPONENTS; do
for arch in $ARCHS; do
mkdir -p $repo/$dist/$component/$arch
done
done
done
# generate repo
apt-ftparchive generate apt-ftparchive.conf
# generate signed & unsigned Release files
for dist in $DISTS; do
apt-ftparchive -c $dist.conf release $repo/$dist > $repo/$dist/Release
gpg --default-key "apt@octoprint.org" -abs -o - $repo/$dist/Release > $repo/$dist/Release.gpg
gpg --default-key "apt@octoprint.org" --clearsign -o - $repo/$dist/Release > $repo/$dist/InRelease
done
tree public
- name: ✍ Generate Directory Listings
run: |
curl https://raw.githubusercontent.com/paperbenni/apindex/master/install.sh | bash
cd public
apindex debian
- name: ⬆ Upload pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
deploy:
name: "Deploy"
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1