From 78d8fb5f5411e383f311037b71a4d18d16f9f3c2 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Thu, 8 Aug 2024 14:44:32 +0100 Subject: [PATCH] ci: test using our own action --- .forgejo/workflows/build.yaml | 23 +++++++++++++++++-- .forgejo/workflows/deploy_to_skynet.yaml | 28 ------------------------ 2 files changed, 21 insertions(+), 30 deletions(-) delete mode 100644 .forgejo/workflows/deploy_to_skynet.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index c668933..8de8bd5 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -1,10 +1,29 @@ name: Build # Build it locally -on: [push] +on: + push: + branches: + - 'main' + paths: + - flake.* + - src/**/* + - .forgejo/**/* + jobs: build: runs-on: nix steps: + # get the repo first + - uses: actions/checkout@v4 - name: "Build the Wiki" - run: nix build --verbose \ No newline at end of file + run: nix build --verbose + + deploy: + runs-on: docker + needs: [ build ] + steps: + - name: "Deploy to Skynet" + uses: https://forgejo.skynet.ie/Skynet/actions-deploy-to-skynet@v1 + with: + input: 'skynet_website_renew' \ No newline at end of file diff --git a/.forgejo/workflows/deploy_to_skynet.yaml b/.forgejo/workflows/deploy_to_skynet.yaml deleted file mode 100644 index cddf12b..0000000 --- a/.forgejo/workflows/deploy_to_skynet.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# This is to deploy it to our nixos repo - -name: Deploy - -on: - # for testing - workflow_dispatch: - inputs: - input_to_update: - description: 'Flake input to update' - required: false - type: string - workflow_run: - workflows: [ "Build" ] - types: - - completed - -env: - INPUT: skynet_website_renew - -jobs: - deploy: - runs-on: nix - steps: - - name: "Deploy to Skynet" - run: | - curl -X 'POST' 'https://forgejo.skynet.ie/api/v1/repos/Skynet/nixos/actions/workflows/update_input.yaml/dispatches?token=${{ secrets.API_TOKEN_FORGEJO }}' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"inputs": {"input_to_update": "$INPUT"}, "ref": "main"}' -