Skip to content

Initial commit

Initial commit #22

Workflow file for this run

name: GitHub Pages
on:
push:
branches:
- main
env:
CI_XBPS_PACKAGES: "xdeb-install"
CI_SU: "su - user -c"
jobs:
build:
permissions:
packages: read
runs-on: ubuntu-latest
container:
# TODO: create arch matrix
image: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:x86_64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Create XBPS packages
run: |
# fix ERROR: unshare (Operation not permitted)
echo 1 > /proc/sys/kernel/unprivileged_userns_clone
cp -R templates /home/user/templates
cp -R scripts /home/user/scripts
chown -R user:user /home/user
${CI_SU} '/home/user/scripts/create_packages.sh'
cp -R /home/user/repository ./repository
- name: Create XBPS repository
run: |
echo -n "${{ secrets.XBPS_REPOSITORY_KEY }}" > private.pem
xbps-rindex -a repository/*.xbps
xbps-rindex --sign \
--signedby "${{ github.repository_owner }} <${{ github.event.pusher.email }}>" \
--privkey private.pem \
repository
for pkg in $(ls -d -1 repository/*.xbps); do
xbps-rindex --privkey private.pem --sign-pkg ${pkg}
done
- name: Prepare apindex
run: |
cd apindex
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/apindex
make install
- name: Generate index.html
run: cd repository && /tmp/apindex/bin/apindex .
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: repository
deploy:
needs: build
runs-on: ubuntu-latest
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