Skip to content

Deploy Debian and RPM Repo plus Jekyll homepage #47

Deploy Debian and RPM Repo plus Jekyll homepage

Deploy Debian and RPM Repo plus Jekyll homepage #47

Workflow file for this run

# Huge swathes of this file are inspired by:
# - https://earthly.dev/blog/creating-and-hosting-your-own-rpm-packages-and-yum-repo/
# - https://earthly.dev/blog/creating-and-hosting-your-own-deb-packages-and-apt-repo/
#
# This file was also based on the Jekyll page builder which is a default from Github.
name: Deploy Debian and RPM Repo plus Jekyll homepage
on:
schedule:
- cron: "0 0 * * *"
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install required packages
run: |
until sudo apt update
do
sleep 1
done
sudo apt install -y jq createrepo-c coreutils gnupg2 dpkg-dev
- name: Insert environment variables
run: |
echo GNUPGHOME="$(mktemp -d /tmp/pgpkeys-XXXXXX)" >> $GITHUB_ENV
echo REPO_OWNER="$(echo "${GITHUB_REPOSITORY}" | cut -d/ -f1)" >> $GITHUB_ENV
echo REPO_NAME="$(echo "${GITHUB_REPOSITORY}" | cut -d/ -f2)" >> $GITHUB_ENV
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.PRIVATE_KEY }}
- name: Confirm GPG Key loaded
run: |
gpg --list-keys
echo "${{ steps.import_gpg.outputs.fingerprint }}"
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Set permissions on the _site directory
run: sudo chown -R runner:docker _site
- name: Build DEB and APT Repos
run: |
export GPG_FINGERPRINT="${{ steps.import_gpg.outputs.fingerprint }}"
export ORIGIN="${{ steps.import_gpg.outputs.name }}"
.github/scripts/build_repos.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1