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 git - name: Check out repository code uses: actions/checkout@v3 - 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` echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add - mkdir -p $HOME/.ssh chmod 700 $HOME/.ssh echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts echo "${{ secrets.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 -4 -r zones catalog-zones ${{ secrets.SSH_PRIMARY_NS }}:/var/lib/knot/ ssh -4 ${{ secrets.SSH_PRIMARY_NS }} /usr/sbin/knotc reload