Automated deployment
This commit is contained in:
@@ -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 }}."
|
||||
@@ -83,3 +84,37 @@ jobs:
|
||||
# run: |
|
||||
# ls ${{ gitea.workspace }}
|
||||
# - 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
|
||||
|
||||
Reference in New Issue
Block a user