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