Files
lancache-adguardhome-config/.gitea/workflows/gen.yaml
2025-04-14 22:58:00 +02:00

85 lines
2.6 KiB
YAML

name: Run temp script and capture output
on:
schedule:
- cron: "0 0 * * *" # tous les jours à 3h du mat
workflow_dispatch: # optionnel : exécution manuelle
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Send ntfy notification (Run Started)
run: |
curl \
-u ${{ secrets.NTFY_AUTH }} \
-H "Title: LanCache AGH conf generation started" \
-H "Priority: 5" \
-d "Generating AdguardHome config for Lancache" \
https://ntfy.uzurka.fr/lancache
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H git.ssh.uzurka.fr >> ~/.ssh/known_hosts
- name: Generate lancache.conf
run: |
git clone https://github.com/uklans/cache-domains.git
cd cache-domains
cat <<EOF > scripts/config.json
{
"combined_output": true,
"ips": {
"monolithic": ["10.10.1.20"]
},
"cache_domains": {
"blizzard": "monolithic",
"epicgames": "monolithic",
"nintendo": "monolithic",
"origin": "monolithic",
"riot": "monolithic",
"sony": "monolithic",
"steam": "monolithic",
"uplay": "monolithic",
"wsus": "monolithic"
}
}
EOF
cat scripts/config.json
cd scripts
bash create-adguardhome.sh
cp output/adguardhome/lancache.conf /tmp/artifacts/lancache.conf
- name: Cat /tmp/artifacts/lancache.conf
run: |
cat /tmp/artifacts/lancache.conf
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: output
path: /tmp/artifacts/lancache.conf
- name: Send ntfy notification (Success)
if: success()
run: |
curl \
-u ${{ secrets.NTFY_AUTH }} \
-H "LanCache AGH conf generation succeed" \
-H "Priority: 5" \
-d "LanCache AGH conf generation succeed" \
https://ntfy.uzurka.fr/lancache
- name: Send ntfy notification (Failure)
if: failure()
run: |
curl \
-u ${{ secrets.NTFY_AUTH }} \
-H "LanCache AGH conf generation failed" \
-H "Priority: 5" \
-d "LanCache AGH conf generation failed" \
https://ntfy.uzurka.fr/lancache