From f54c1c2a07c5f0ea810afca56a14cac6da5fea5f Mon Sep 17 00:00:00 2001 From: Hayajiro Date: Sun, 19 Nov 2023 19:48:48 +0100 Subject: [PATCH] Add config for gitea actions --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++ .github/workflows/update.yml | 24 +++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..79fd437 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: ci +on: + push: + branches: + - master + +jobs: + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Flake check + run: nix flake check + + deploy: + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/master' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Load ssh key + uses: webfactory/ssh-agent@v0.8.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Deploy + run: nix develop --command deploy diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..10fc6b4 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,24 @@ +name: update-flake-inputs +on: + schedule: + - cron: '0 0 * * 0' # runs weekly on Sunday at 00:00 + +jobs: + update-lockfile: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v23 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.AUTOUPDATE_TOKEN }} + - name: Update flake.lock + uses: DeterminateSystems/update-flake-lock@v20 + with: + pr-title: "update flake inputs" + pr-labels: | + update + automated