From 012ed87156abaeaede50ed9e0e37fdf21a3837ea Mon Sep 17 00:00:00 2001 From: alex 3 Date: Sun, 5 Nov 2023 18:22:14 -0500 Subject: [PATCH 1/3] Add rebuild action --- .github/workflows/rebuild.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/rebuild.yml diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml new file mode 100644 index 0000000..34c816f --- /dev/null +++ b/.github/workflows/rebuild.yml @@ -0,0 +1,22 @@ +name: Trigger pull & rebuild + +on: + push: + branches: + - main + +jobs: + post: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Send POST request + run: | + curl -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer ${{ secrets.PTERO_TOKEN }}" \ + -d '{"signal": "restart"}' \ + https://panel.thatalex.dev/api/client/servers/457f4d77/power From fb963aa94d07bd7afb0fff2386669fa1bd9e5267 Mon Sep 17 00:00:00 2001 From: alex 3 Date: Sun, 5 Nov 2023 18:24:07 -0500 Subject: [PATCH 2/3] Only trigger remote rebuild when a release is created --- .github/workflows/rebuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index 34c816f..ac232bf 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -1,9 +1,9 @@ name: Trigger pull & rebuild on: - push: - branches: - - main + release: + types: [created] + workflow_dispatch: jobs: post: From 828963bf5cc8a446438c0a8eb88b5fb571d3a23b Mon Sep 17 00:00:00 2001 From: alex 3 Date: Sun, 5 Nov 2023 18:28:31 -0500 Subject: [PATCH 3/3] update ptero action key --- .github/workflows/rebuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index ac232bf..1a6932a 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -17,6 +17,6 @@ jobs: run: | curl -X POST \ -H "Content-Type: application/json" \ - -H "Authorization: Bearer ${{ secrets.PTERO_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.PTERO_SECRET }}" \ -d '{"signal": "restart"}' \ https://panel.thatalex.dev/api/client/servers/457f4d77/power