Skip to content

Commit

Permalink
fix: use external discord webhook action
Browse files Browse the repository at this point in the history
  • Loading branch information
Panakotta00 committed Oct 24, 2024
1 parent 53c8f99 commit ed2e482
Showing 1 changed file with 4 additions and 78 deletions.
82 changes: 4 additions & 78 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,86 +115,12 @@ jobs:
# %LocalAppData%\FactoryGame\Saved\FINReflectionDocumentation.json
# %LocalAppData%\FactoryGame\Saved\FINLuaDocumentation.lua

- name: Create Discord Webhook Action
uses: devops-actions/[email protected]
if: success()
with:
filename: "discord-webhook.json"
json: >
{
"username": "GitHub",
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128",
"embeds": [{
"title": "${{ github.ref_name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Build Successful!",
"color": 65280,
"fields": [{
"value": "[FicsIt-Networks.zip](${{ steps.upload-win64.outputs.artifact-url }})",
"name": "",
"inline": true
}]
}]
}
- name: Create Discord Webhook Action
uses: devops-actions/[email protected]
if: cancelled()
with:
filename: "discord-webhook.json"
json: >
{
"username": "GitHub",
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128",
"embeds": [{
"title": "${{ github.ref_name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Build Cancelled!",
"color": 13158580
}]
}
- name: Create Discord Webhook Action
uses: devops-actions/[email protected]
if: failure()
with:
filename: "discord-webhook.json"
json: >
{
"username": "GitHub",
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128",
"embeds": [{
"title": "${{ github.ref_name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Build Failed",
"color": 16711680
}]
}
- name: Create Discord Webhook Action
uses: devops-actions/[email protected]
if: ${{ !success() && !failure() && !cancelled() }}
with:
filename: "discord-webhook.json"
json: >
{
"username": "GitHub",
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128",
"embeds": [{
"title": "${{ github.ref_name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Build Done!",
"color": 6579300
}]
}
- name: Discord Webhook Action
uses: tsickert/[email protected]
if: always()
uses: Panakotta00/[email protected]
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
raw-data: discord-webhook.json
# embed-title: ${{ github.ref_name }}
# embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
# embed-description: Build ${{ success() && 'Successful' || cancelled() && 'Cancelled' || failure() && 'Failed' || 'Done' }}!
# embed-color: ${{ success() && '65280' || cancelled() && '13158580' || failure() && '16711680' || '6579300' }}
artifact-url: ${{ steps.upload-win64.outputs.artifact-url }}
artifact-name: 'FicsIt-Networks.zip'

- name: Post Cleanup
if: ${{ !failure() }}
run: Remove-Item C:\actions-runner\_work\FicsIt-Networks\FicsIt-Networks\* -Recurse -Force -Confirm:$false -ErrorAction Ignore
Expand Down

0 comments on commit ed2e482

Please sign in to comment.