|
@@ -18,7 +18,13 @@ jobs:
|
|
|
if_no_artifact_found: warn
|
|
|
- name: get server name
|
|
|
run: |
|
|
|
- echo "SERVER=$(cat ./server/server) >> $GITHUB_ENV"
|
|
|
+ echo "SERVER=$(cat ./server/server)" >> $GITHUB_ENV
|
|
|
+ - name: get PR
|
|
|
+ env:
|
|
|
+ GH_TOKEN: ${{ github.token }}
|
|
|
+ run: |
|
|
|
+ echo "pull_request=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-Github-Api-Version: 2022-11-28' \
|
|
|
+ /repos/${{ github.repository}}/actions/runs/${{ github.event.workflow_run.id }} | jq .pull_requests[0].number)" >> $GITHUB_ENV
|
|
|
- name: discord success message
|
|
|
uses: appleboy/discord-action@master
|
|
|
with:
|
|
@@ -32,7 +38,7 @@ jobs:
|
|
|
if: success() || failure()
|
|
|
run: |
|
|
|
sleep 15m
|
|
|
- curl -X GET \
|
|
|
+ curl -X DELETE \
|
|
|
-H "Content-Type: application/json" \
|
|
|
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
|
|
|
"https://api.digitalocean.com/v2/droplets?tag_name=$TAG"
|
|
@@ -40,6 +46,7 @@ jobs:
|
|
|
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
|
|
TAG: ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
|
|
|
- name: mark server as available
|
|
|
+ if: success() || failure()
|
|
|
uses: appleboy/ssh-action@master
|
|
|
with:
|
|
|
host: server.${{ env.SERVER }}.clustercat.com
|
|
@@ -59,7 +66,13 @@ jobs:
|
|
|
if_no_artifact_found: warn
|
|
|
- name: get server name
|
|
|
run: |
|
|
|
- echo "SERVER=$(cat ./server/server) >> $GITHUB_ENV"
|
|
|
+ echo "SERVER=$(cat ./server/server)" >> $GITHUB_ENV
|
|
|
+ - name: get PR
|
|
|
+ env:
|
|
|
+ GH_TOKEN: ${{ github.token }}
|
|
|
+ run: |
|
|
|
+ echo "pull_request=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-Github-Api-Version: 2022-11-28' \
|
|
|
+ /repos/${{ github.repository}}/actions/runs/${{ github.event.workflow_run.id }} | jq .pull_requests[0].number)" >> $GITHUB_ENV
|
|
|
- name: discord failure message
|
|
|
uses: appleboy/discord-action@master
|
|
|
with:
|
|
@@ -82,7 +95,7 @@ jobs:
|
|
|
if: success() || failure()
|
|
|
run: |
|
|
|
sleep 3h
|
|
|
- curl -X GET \
|
|
|
+ curl -X DELETE \
|
|
|
-H "Content-Type: application/json" \
|
|
|
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
|
|
|
"https://api.digitalocean.com/v2/droplets?tag_name=$TAG"
|
|
@@ -90,6 +103,7 @@ jobs:
|
|
|
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
|
|
TAG: ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
|
|
|
- name: mark server as available
|
|
|
+ if: success() || failure()
|
|
|
uses: appleboy/ssh-action@master
|
|
|
with:
|
|
|
host: server.${{ env.SERVER }}.clustercat.com
|