From 66d797f440339a998fae9f5f5ebfc8d81defaa86 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Thu, 8 Aug 2024 14:13:28 +0100 Subject: [PATCH] ci: added new actions --- .forgejo/workflows/build.yaml | 10 +++++++++ .forgejo/workflows/demo.yaml | 6 ----- .forgejo/workflows/deploy_to_skynet.yaml | 28 ++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .forgejo/workflows/build.yaml delete mode 100644 .forgejo/workflows/demo.yaml create mode 100644 .forgejo/workflows/deploy_to_skynet.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..c668933 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,10 @@ +name: Build +# Build it locally + +on: [push] +jobs: + build: + runs-on: nix + steps: + - name: "Build the Wiki" + run: nix build --verbose \ No newline at end of file diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml deleted file mode 100644 index e883d77..0000000 --- a/.forgejo/workflows/demo.yaml +++ /dev/null @@ -1,6 +0,0 @@ -on: [push] -jobs: - test: - runs-on: ubuntu-latest - steps: - - run: echo All Good \ No newline at end of file diff --git a/.forgejo/workflows/deploy_to_skynet.yaml b/.forgejo/workflows/deploy_to_skynet.yaml new file mode 100644 index 0000000..cddf12b --- /dev/null +++ b/.forgejo/workflows/deploy_to_skynet.yaml @@ -0,0 +1,28 @@ +# 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"}' +