From cd397b1d156f69de2bf759acae9f911ecd04f9ce Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Mon, 31 Mar 2025 15:28:57 -0700 Subject: [PATCH] Automated deployment --- .gitea/workflows/build.yaml | 39 +++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 24021a5..d203216 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -70,8 +70,9 @@ jobs: test: runs-on: ubuntu-latest + needs: build_and_push steps: - - run: echo "Tests would go here" + - run: echo "Placeholder" # - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." # - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" # - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." @@ -82,4 +83,38 @@ jobs: # - name: List files in the repository # run: | # ls ${{ gitea.workspace }} -# - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file +# - run: echo "🍏 This job's status is ${{ job.status }}." + deploy_production: + runs-on: ubuntu-latest + needs: test + steps: + - name: Pull New Image For App + run: | + curl -k -X 'POST' \ + 'https://caperren.com:444/api/v2.0/app/pull_images' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \ + -H 'Content-Type: application/json' \ + -d '{ + "name": "caperren-com", + "options": {} + }' + - name: Stop App + run: | + curl -X 'POST' \ + 'https://caperren.com:444/api/v2.0/app/stop' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \ + -H 'Content-Type: application/json' \ + -d '"caperren-com"' \ + || true + - name: Stop Existing App + - name: Start App + run: | + curl -X 'POST' \ + 'https://caperren.com:444/api/v2.0/app/stop' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \ + -H 'Content-Type: application/json' \ + -d '"caperren-com"' \ + || true