|
@@ -16,6 +16,9 @@ jobs:
|
|
|
with:
|
|
|
run_id: ${{ github.event.workflow_run.id}}
|
|
|
if_no_artifact_found: warn
|
|
|
+ - name: get server name
|
|
|
+ run: |
|
|
|
+ echo "SERVER=$(cat ./server/server) >> $GITHUB_ENV"
|
|
|
- name: discord success message
|
|
|
uses: appleboy/discord-action@master
|
|
|
with:
|
|
@@ -23,7 +26,7 @@ jobs:
|
|
|
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
|
|
color: "#42f545"
|
|
|
username: "GitHub Bot"
|
|
|
- message: "${{ github.repository }}: ${{ github.event.workflow_run.name }} was successful: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}) will be deleted in 15 min"
|
|
|
+ message: "${{ github.repository }}: ${{ github.event.workflow_run.name }} on dashboard.${{ env.SERVER }}.clustercat.com was successful: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}) will be deleted in 15 min"
|
|
|
file: ./results/results.log
|
|
|
- name: delete droplets
|
|
|
if: success() || failure()
|
|
@@ -36,6 +39,14 @@ jobs:
|
|
|
env:
|
|
|
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
|
|
TAG: ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
|
|
|
+ - name: mark server as available
|
|
|
+ uses: appleboy/ssh-action@master
|
|
|
+ with:
|
|
|
+ host: server.${{ env.SERVER }}.clustercat.com
|
|
|
+ username: root
|
|
|
+ key: ${{ secrets.TESTING_SSH_KEY }}
|
|
|
+ script: |
|
|
|
+ rm /tmp/branchtest
|
|
|
|
|
|
on-failure:
|
|
|
runs-on: ubuntu-latest
|
|
@@ -46,6 +57,9 @@ jobs:
|
|
|
with:
|
|
|
run_id: ${{ github.event.workflow_run.id}}
|
|
|
if_no_artifact_found: warn
|
|
|
+ - name: get server name
|
|
|
+ run: |
|
|
|
+ echo "SERVER=$(cat ./server/server) >> $GITHUB_ENV"
|
|
|
- name: discord failure message
|
|
|
uses: appleboy/discord-action@master
|
|
|
with:
|
|
@@ -53,7 +67,7 @@ jobs:
|
|
|
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
|
|
color: "#990000"
|
|
|
username: "GitHub Bot"
|
|
|
- message: "${{ github.repository }}: ${{ github.event.workflow_run.name }} failed: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt}}) will be deleted in 5 hours"
|
|
|
+ message: "${{ github.repository }}: ${{ github.event.workflow_run.name }} failed: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt}}) will be deleted in 3 hours"
|
|
|
file: ./results/results.log
|
|
|
- name: discord error message
|
|
|
uses: appleboy/discord-action@master
|
|
@@ -67,7 +81,7 @@ jobs:
|
|
|
- name: delete droplets
|
|
|
if: success() || failure()
|
|
|
run: |
|
|
|
- sleep 5h
|
|
|
+ sleep 3h
|
|
|
curl -X GET \
|
|
|
-H "Content-Type: application/json" \
|
|
|
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
|
|
@@ -75,3 +89,11 @@ jobs:
|
|
|
env:
|
|
|
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
|
|
TAG: ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
|
|
|
+ - name: mark server as available
|
|
|
+ uses: appleboy/ssh-action@master
|
|
|
+ with:
|
|
|
+ host: server.${{ env.SERVER }}.clustercat.com
|
|
|
+ username: root
|
|
|
+ key: ${{ secrets.TESTING_SSH_KEY }}
|
|
|
+ script: |
|
|
|
+ rm /tmp/branchtest
|