From fc48a9749d1031472963ac95cc4830aec08b8d1a Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 31 Oct 2024 11:24:51 +0530 Subject: [PATCH] Cleanup actions to run on forgejo --- .forgejo/workflows/cachix.yaml | 63 ++++++++++++++++++++++++++++ .forgejo/workflows/update-inputs.yml | 30 +++++++++++++ .github/workflows/cachix.yaml | 35 ---------------- .github/workflows/update-inputs.yml | 28 ------------- README.md | 2 +- 5 files changed, 94 insertions(+), 64 deletions(-) create mode 100644 .forgejo/workflows/cachix.yaml create mode 100644 .forgejo/workflows/update-inputs.yml delete mode 100644 .github/workflows/cachix.yaml delete mode 100644 .github/workflows/update-inputs.yml diff --git a/.forgejo/workflows/cachix.yaml b/.forgejo/workflows/cachix.yaml new file mode 100644 index 0000000..2bb8bdf --- /dev/null +++ b/.forgejo/workflows/cachix.yaml @@ -0,0 +1,63 @@ +name: Build and Push to Cachix +on: + push: + branches: + - main + workflow_run: + workflows: ['Update Inputs'] + types: [completed] + branches: + - main + workflow_dispatch: + +jobs: + publish-x86_64: + name: Push to Binary Cache (X86-64) + runs-on: x86_64-docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Nix + uses: https://github.com/cachix/install-nix-action@V27 + with: + nix_path: nixpkgs=channel:nixos-unstable + github_access_token: ${{ secrets.GH_PUBLIC_REPO_ACCESS_TOKEN }} + + - name: Authenticate with Cachix + uses: https://github.com/cachix/cachix-action@v15 + with: + name: adtya + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Build and push flake output + run: | + nix build -L .#caddy --access-tokens "github.com=${{ secrets.GH_PUBLIC_REPO_ACCESS_TOKEN }}" + + publish-aarch64: + name: Push to Binary Cache (aarch64) + runs-on: aarch64-docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Nix + uses: https://github.com/cachix/install-nix-action@V27 + with: + nix_path: nixpkgs=channel:nixos-unstable + github_access_token: ${{ secrets.GH_PUBLIC_REPO_ACCESS_TOKEN }} + + - name: Authenticate with Cachix + uses: https://github.com/cachix/cachix-action@v15 + with: + name: adtya + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Build and push flake output + run: | + nix build -L .#caddy --access-tokens "github.com=${{ secrets.GH_PUBLIC_REPO_ACCESS_TOKEN }}" + diff --git a/.forgejo/workflows/update-inputs.yml b/.forgejo/workflows/update-inputs.yml new file mode 100644 index 0000000..e8ff4d4 --- /dev/null +++ b/.forgejo/workflows/update-inputs.yml @@ -0,0 +1,30 @@ +name: Update Inputs + +on: + schedule: + - cron: "0 0 * * 5" + workflow_dispatch: + +jobs: + update-inputs: + runs-on: docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 + name: Update Inputs + steps: + - uses: actions/checkout@v4 + with: + token: ${{ github.token }} + ref: ${{ github.head_ref }} + - uses: https://github.com/cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-unstable + github_access_token: ${{ secrets.GH_PUBLIC_REPO_ACCESS_TOKEN }} + - name: Update inputs + run: | + nix flake update --access-tokens "github.com=${{ secrets.GH_PUBLIC_REPO_ACCESS_TOKEN }}" + - name: Commit changes + uses: https://github.com/EndBug/add-and-commit@v9 + with: + message: 'Actions: Update Inputs' + add: 'flake.lock' diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml deleted file mode 100644 index 84e3da9..0000000 --- a/.github/workflows/cachix.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build and Push to Cachix -on: - push: - branches: - - main - workflow_run: - workflows: ['Update Inputs'] - types: [completed] - branches: - - main - -jobs: - publish: - name: Publish Flake - runs-on: ubuntu-latest - strategy: - matrix: - architecture: [x86_64, aarch64] - - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install nix - uses: cachix/install-nix-action@V27 - - - name: Authenticate with Cachix - uses: cachix/cachix-action@v15 - with: - name: adtya - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Build nix flake - run: nix build -L .#caddy - diff --git a/.github/workflows/update-inputs.yml b/.github/workflows/update-inputs.yml deleted file mode 100644 index 15edc78..0000000 --- a/.github/workflows/update-inputs.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Update Inputs - -on: - schedule: - - cron: "0 0 * * 5" - workflow_dispatch: - -jobs: - update-inputs: - runs-on: ubuntu-latest - name: Update Inputs - steps: - - uses: actions/checkout@v3 - with: - token: ${{ github.token }} - ref: ${{ github.head_ref }} - - uses: cachix/install-nix-action@v20 - with: - github_access_token: ${{ github.token }} - - name: Update inputs - run: | - nix flake update - - name: Commit changes - uses: EndBug/add-and-commit@v9 - with: - message: 'Actions: Update Inputs' - default_author: github_actions - add: 'flake.lock' diff --git a/README.md b/README.md index ba84e4b..b71caa4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# A [Caddy](https://caddyserver.com/) build that includes the [Digitalocean DNS module](https://github.com/caddy-dns/digitalocean) +# A [Caddy](https://caddyserver.com/) build that includes the [Hetzner DNS module](https://github.com/caddy-dns/hetzner) ## Stolen from [pinpox](https://github.com/pinpox/nixos-caddy-patched) and [Ramblurr](https://github.com/Ramblurr/nixos-caddy) ### Explore further: