Add scheduled deploy workflow
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 30m24s
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 30m24s
This commit is contained in:
parent
d3938839ee
commit
8a0924c36c
1 changed files with 55 additions and 0 deletions
55
.forgejo/workflows/scheduled-deploy.yaml
Normal file
55
.forgejo/workflows/scheduled-deploy.yaml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
name: Scheduled Deploy DNS Configuration
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 1 * * *"
|
||||
|
||||
jobs:
|
||||
scheduled-deploy:
|
||||
runs-on: self-hosted
|
||||
env:
|
||||
DEBUG: 1
|
||||
DEBUG_LOG: /tmp/generate-configs.debug.log
|
||||
INPUT_FILE: domains.txt
|
||||
IPSET_CONF: /tmp/91-ipset-bbrkn.conf
|
||||
RESOLVE_CONF: /tmp/92-resolve-bbrkn.conf
|
||||
DNS_SERVER: 8.8.8.8
|
||||
API_URL: http://10.100.1.2:3000/domains?domain=
|
||||
TARGET_DIR: /opt/appdata/pihole/etc/dnsmasq.d
|
||||
DOCKER_CONTAINER: pihole
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate domains file
|
||||
run: |
|
||||
if [ ! -f domains.txt ]; then
|
||||
echo "Error: domains.txt not found"
|
||||
exit 1
|
||||
fi
|
||||
grep -v '^#' domains.txt | grep -v '^$' | while read domain; do
|
||||
if ! echo "$domain" | grep -qE '^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$'; then
|
||||
echo "Error: Invalid domain format: $domain"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Prepare Makefile
|
||||
run: |
|
||||
chmod +x scripts/generate-configs.sh
|
||||
chmod +x scripts/deploy-to-gateway.sh
|
||||
|
||||
- name: Run workflow (clean → all)
|
||||
run: |
|
||||
make clean
|
||||
make all
|
||||
|
||||
- name: Upload configs as artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dnsmasq-configs-scheduled
|
||||
path: |
|
||||
${{ env.IPSET_CONF }}
|
||||
${{ env.RESOLVE_CONF }}
|
||||
${{ env.DEBUG_LOG }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue