.forgejo/workflows/ci.yaml: adaptation to auto cancel
DNS automated deployment / deploy (push) Successful in 2s Details

This commit is contained in:
Adrien Bourmault 2024-08-20 19:31:36 +02:00
parent 2980b3599a
commit 0acc17edee
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 6 additions and 3 deletions

View File

@ -1,20 +1,22 @@
name: DNS automated deployment
on:
push:
branches:
- 'main'
jobs:
deploy_script:
deploy:
runs-on: linux_amd64
steps:
- name: Apply zone changes
shell: bash
run: |
LAST_RUN=$(cat /home/runner/last_run)
CURRENT_ZONE=
echo "Preparing to update ${{ vars.DNS_SERVER }}..."
git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns
cd dns
git diff HEAD^ HEAD > zone_diff.txt
git diff $LAST_RUN ${{ env.GITHUB_SHA }} > zone_diff.txt
echo "${{ secrets.TSIG_KEY }}" | base64 -d > temp_keyfile
while IFS= read -r line; do
case "$line" in
@ -48,3 +50,4 @@ jobs:
esac
done < zone_diff.txt
rm temp_keyfile
echo ${{ env.GITHUB_SHA }} > /home/runner/last_run