First commit to bbrkn project
This commit is contained in:
parent
60185625e6
commit
0e03de0178
4 changed files with 383 additions and 0 deletions
37
.forgejo/workflows/deploy.yaml
Normal file
37
.forgejo/workflows/deploy.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue