bbrkn/.forgejo/workflows/deploy.yaml
2025-09-09 21:21:38 +03:00

37 lines
1.1 KiB
YAML

name: Deploy DNS Configuration
on:
push:
branches: [ main ]
paths: [ 'domains.txt' ]
jobs:
deploy:
runs-on: self-hosted # Используем self-hosted runner на шлюзе
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-Z]{2,}$'; then
echo "Error: Invalid domain format: $domain"
exit 1
fi
done
- name: Generate dnsmasq configuration files
run: |
chmod +x scripts/generate-configs.sh
./scripts/generate-configs.sh
- name: Deploy to gateway
run: |
chmod +x scripts/deploy-to-gateway.sh
./scripts/deploy-to-gateway.sh