From b2afd707caad0fc4ac0efa8004c8da3addd5f53b Mon Sep 17 00:00:00 2001 From: Ketan Vijayvargiya Date: Fri, 14 Jun 2024 06:18:15 -0700 Subject: [PATCH] Add Forgejo action to publish DNS records upstream. --- .forgejo/workflows/update-dns-upstream.yaml | 21 +++++++++++++++++++++ flake.nix | 8 +++----- 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .forgejo/workflows/update-dns-upstream.yaml diff --git a/.forgejo/workflows/update-dns-upstream.yaml b/.forgejo/workflows/update-dns-upstream.yaml new file mode 100644 index 0000000..be9d15b --- /dev/null +++ b/.forgejo/workflows/update-dns-upstream.yaml @@ -0,0 +1,21 @@ +name: update-dns-upstream +on: [push] + +jobs: + execute: + runs-on: docker + container: + image: node:latest + env: + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.cloudflare_account_id }} + CLOUDFLARE_API_TOKEN: ${{ secrets.cloudflare_api_token }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - name: Update DNS upstream + shell: bash + run: | + nix run . -- version + nix run . -- push diff --git a/flake.nix b/flake.nix index 123de48..3644d22 100644 --- a/flake.nix +++ b/flake.nix @@ -5,9 +5,7 @@ outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in { - packages.default = nixpkgs.legacyPackages.${system}.dnscontrol; - }); + { + packages.default = nixpkgs.legacyPackages.${system}.dnscontrol; + }); }