mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-20 15:26:04 +08:00
discord message after branch test run
This commit is contained in:
parent
619c57f9c3
commit
ef898d5d91
55
.github/workflows/deletedroplets.yml
vendored
55
.github/workflows/deletedroplets.yml
vendored
|
@ -11,6 +11,29 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- name: get logs
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
run_id: ${{ github.event.workflow_run.id}}
|
||||
if_no_artifact_found: warn
|
||||
- name: discord success message
|
||||
uses: appleboy/discord-action@master
|
||||
with:
|
||||
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
||||
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
||||
color: "#42f545"
|
||||
username: "GitHub Bot"
|
||||
message: " ${{ github.event.workflow_run.name }} was successful"
|
||||
file: ./results/results.log
|
||||
- name: discord server message
|
||||
uses: appleboy/discord-action@master
|
||||
with:
|
||||
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
||||
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
||||
color: "#42f545"
|
||||
username: "GitHub Bot"
|
||||
message: "droplets from this workflow will be deleted in 15 min"
|
||||
file: ./server/serverinfo.txt
|
||||
- name: delete droplets
|
||||
run: |
|
||||
sleep 15m
|
||||
|
@ -26,6 +49,38 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
steps:
|
||||
- name: get logs
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
run_id: ${{ github.event.workflow_run.id}}
|
||||
if_no_artifact_found: warn
|
||||
- name: discord failure message
|
||||
uses: appleboy/discord-action@master
|
||||
with:
|
||||
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
||||
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
||||
color: "#42f545"
|
||||
username: "GitHub Bot"
|
||||
message: " ${{ github.event.workflow_run.name }} failed"
|
||||
file: ./results/results.log
|
||||
- name: discord server message
|
||||
uses: appleboy/discord-action@master
|
||||
with:
|
||||
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
||||
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
||||
color: "#42f545"
|
||||
username: "GitHub Bot"
|
||||
message: "droplets from this workflow will be deleted in 6 hours"
|
||||
file: ./server/serverinfo.txt
|
||||
- name: discord error message
|
||||
uses: appleboy/discord-action@master
|
||||
with:
|
||||
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
||||
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
||||
color: "#990000"
|
||||
username: "GitHub Bot"
|
||||
message: "errors from ${{ github.event.workflow_run.name }}"
|
||||
file: ./results/errors.log
|
||||
- name: delete droplets
|
||||
run: |
|
||||
sleep 6h
|
||||
|
|
Loading…
Reference in a new issue