From 0160a2fc0afdde4bf75fc94aab633f9c14b1c472 Mon Sep 17 00:00:00 2001 From: whilefoo Date: Fri, 15 Mar 2024 18:25:58 +0100 Subject: [PATCH] feat: setup action --- .github/workflows/compute.yml | 36 +++++++++++++++++++++++++++++++++++ action.yml | 16 ++++++++++++++++ package.json | 3 +-- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/compute.yml create mode 100644 action.yml diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml new file mode 100644 index 0000000..c1ae788 --- /dev/null +++ b/.github/workflows/compute.yml @@ -0,0 +1,36 @@ +name: Delegated Compute + +on: + workflow_dispatch: + inputs: + stateId: + required: true + eventName: + required: true + eventPayload: + required: true + settings: + required: true + authToken: + required: true + ref: + required: true + +jobs: + run: + runs-on: ubuntu-latest + permissions: write-all + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Echo inputs + run: echo ${{ inputs.settings }} + + - name: Calling action + uses: ./ + with: + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..5be03a6 --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +name: "Delegate Compute" +description: "UbiquiBot Delegated Compute Action" +outputs: + result: # id of output + description: "The result of a event handler" + value: ${{ steps.mainHandler.outputs.result}} +runs: + using: "composite" + steps: + - run: cd ${{ github.action_path }} + shell: bash + - run: pnpm install + shell: bash + - run: pnpm start + shell: bash + id: mainHandler \ No newline at end of file diff --git a/package.json b/package.json index c09e27f..792cb30 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,7 @@ "node": ">=20.10.0" }, "scripts": { - "start": "tsx build/esbuild-server.ts", - "build": "tsx build/esbuild-build.ts", + "start": "tsx src/index.ts", "format": "run-s format:lint format:prettier format:cspell", "format:lint": "eslint --fix .", "format:prettier": "prettier --write .",