Gaël Berthaud-Müller
02b4b0893f
Some checks failed
Deploy zones / Deploy-Zones (push) Failing after 10s
31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
name: Deploy zones
|
|
on: [push]
|
|
|
|
jobs:
|
|
Deploy-Zones:
|
|
runs-on: debian-stable
|
|
steps:
|
|
- name: Install dependencies
|
|
run: apt-get update && apt-get install -y knot-dnsutils ssh-client
|
|
- name: Build catalog zone
|
|
run: |
|
|
for zonefile in zones/*; do
|
|
zone=$(basename $zonefile .zone)
|
|
echo "Checking zone $zone..."
|
|
kzonecheck -v -o $zone $zonefile
|
|
echo $(echo -n $zone | sha1sum | cut -f1 -d' ').zones 0 IN PTR $zone. >> catalog-zones/dns-witch-catalog.zone
|
|
done
|
|
- name: Configure SSH client
|
|
run: |
|
|
eval `ssh-agent -s`
|
|
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
|
|
mkdir -p $HOME/.ssh
|
|
chmod 700 $HOME/.ssh
|
|
echo "${{ secret.SSH_KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts
|
|
echo "${{ secret.SSH_CONFIG }}" >> $HOME/.ssh/config
|
|
chmod 644 $HOME/.ssh/{known_hosts,config}
|
|
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> $GITHUB_ENV
|
|
- name: Deploy zones
|
|
run: |
|
|
scp -r zones catalog-zones ${SSH_PRIMARY_NS}:/var/lib/knot/
|
|
ssh ${SSH_PRIMARY_NS} /usr/sbin/knotc reload
|