From 7ad8cc54d475dac6cca3e82e91234c40ae86c3d3 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Thu, 6 Jul 2023 21:22:22 -0900 Subject: [PATCH] Add actions --- .gitea/workflows/UpdateServer.yaml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .gitea/workflows/UpdateServer.yaml diff --git a/.gitea/workflows/UpdateServer.yaml b/.gitea/workflows/UpdateServer.yaml new file mode 100644 index 0000000..220ad32 --- /dev/null +++ b/.gitea/workflows/UpdateServer.yaml @@ -0,0 +1,32 @@ +name: Update Server +run-name: Update Server +on: [push] +jobs: + Primary Server Repo Update: + runs-on: ubuntu-latest + steps: + - name: Setup Git - Initial + run: git config --global user.email me@nicholaspease.com && git config --global user.name "AutoBuild" && git config --global url."${{ secrets.TOKEN_GITEA_URL }}".insteadOf "https://gitea.nicholaspease.com/" + - name: Clone the Repo + run: git clone --recurse-submodules https://gitea.nicholaspease.com/npease/server-scripts.git + - name: Setup Git - Post Clone + working-directory: ./server-scripts + run: git config pull.rebase false + - name: Update Submodules + working-directory: ./server-scripts + run: git submodule update --remote + - name: Add Everything + working-directory: ./server-scripts + run: git add * + - name: Commit + working-directory: ./server-scripts + run: git commit -m "Autoupdate Commit - ${{ gitea.repository }}" + - name: Push + working-directory: ./server-scripts + run: git push + Physical Server Update Trigger: + runs-on: ubuntu-latest + needs: Primary Server Repo Update + steps: + - name: Send Update Webhook + run: curl --header "Content-Type:application/json" --request POST --data '{"auth":"${{ secrets.SELFHOST_AUTHENTICATION }}","service":"satellitepredictiongenerator"}' https://updater.nicholaspease.com/update \ No newline at end of file