Update .github/workflows/update-repo.yml

This commit is contained in:
2026-04-14 15:54:47 +02:00
parent 30912e9a0e
commit 57c4fec84a

View File

@@ -8,7 +8,7 @@ on:
jobs:
build-and-deploy:
# Use 'host' so the runner can move files directly to your web directory
# Use 'host' so the runner can move files directly to /var/www/arch-repo
runs-on: ubuntu-latest
steps:
@@ -37,7 +37,7 @@ jobs:
# 2. Process Packages
for pkg in *.pkg.tar.zst; do
# Sign package
# Sign package (creates .sig file)
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --no-armor "$pkg"
# Extract Metadata
@@ -54,7 +54,8 @@ jobs:
echo "%CSIZE%"; echo "$(stat -c%s "$pkg")"; echo ""
echo "%ISIZE%"; echo "$(bsdtar -xOf "$pkg" .PKGINFO | grep "^size =" | cut -d' ' -f3)"; echo ""
echo "%PGPSIG%"
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --stdout --no-armor "$pkg" | base64 | tr -d '\n'
# Fixed: Use --output - instead of --stdout
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --no-armor --output - "$pkg" | base64 | tr -d '\n'
echo ""
} > "db_temp/$pkgname-$pkgver/desc"
done
@@ -73,11 +74,48 @@ jobs:
- name: Generate Landing Page
run: |
# Use the same HTML logic as before, just change the URL to your domain
sed -i "s|https://hyprarch-repo.stuple.net|https://your-domain.com|g" index.html
# (Keep your previous landing page generation logic here)
cat <<EOF > index.html
<!DOCTYPE html>
<html>
<head>
<title>HyprArch Repo</title>
<style>
body { font-family: sans-serif; background: #2e3440; color: #eceff4; padding: 40px; line-height: 1.6; }
.container { max-width: 800px; margin: auto; background: #3b4252; padding: 30px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
pre { background: #2e3440; padding: 15px; border-radius: 5px; color: #ebcb8b; overflow-x: auto; border: 1px solid #4c566a; }
h1 { color: #81a1c1; border-bottom: 2px solid #4c566a; padding-bottom: 10px; }
h2 { color: #a3be8c; }
a { color: #88c0d0; text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: #d08770; }
</style>
</head>
<body>
<div class="container">
<h1>🚀 HyprArch Custom Repository</h1>
<h2>1. Trust the GPG Key</h2>
<p>Run this to add the maintainer key to your pacman keyring:</p>
<pre>curl -s https://repo.stuple.net/x86_64/pubkey.gpg | sudo pacman-key -a - && sudo pacman-key --lsign-key 236328A7F2C2001E</pre>
<h2>2. Add to pacman.conf</h2>
<p>Add these lines to the bottom of <code>/etc/pacman.conf</code>:</p>
<pre>[hyprarch-repo]
SigLevel = Required DatabaseOptional
Server = https://repo.stuple.net/\$arch</pre>
<h2>3. Update and Install</h2>
<p><code>sudo pacman -Syy</code></p>
<hr style="border:0; border-top:1px solid #4c566a; margin: 20px 0;">
<p><a href="./x86_64/">📂 Browse File Index</a></p>
<p><small>Hosted on Raspberry Pi 4B • Automated via Gitea Actions</small></p>
</div>
</body>
</html>
EOF
- name: Deploy to Local Web Folder
run: |
# Move everything to the live folder served by Cloudflare
# Copy current build to the Nginx root
cp -r * /var/www/arch-repo/