-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (85 loc) · 3.37 KB
/
Copy pathdeployRelease.yml
File metadata and controls
96 lines (85 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: 'New Release Notification'
env:
SERVER: deploy
on:
release:
types: [published]
workflow_dispatch:
inputs:
release_title:
description: 'Release Title'
required: true
release_body:
description: 'Release Body'
required: true
jobs:
workshopUpload:
runs-on: ubuntu-latest
environment: deploy
outputs:
title: ${{ steps.set-vars.outputs.title }}
body: ${{ steps.set-vars.outputs.body }}
steps:
- uses: actions/checkout@v4
- name: Determine release info
id: set-vars
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "title=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "${{ github.event.release.body }}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "title=${{ github.event.inputs.release_title }}" >> $GITHUB_OUTPUT
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "${{ github.event.inputs.release_body }}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Deploy to Steam
uses: BoldestDungeon/steam-workshop-deploy@V2.0.0
with:
username: ${{ secrets.STEAM_USERNAME }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF }}
appId: 763890
publishedFileId: 2810606541
path: .
changeNote: |
${{ steps.set-vars.outputs.title }}
${{ steps.set-vars.outputs.body }}
notify:
needs: workshopUpload
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Check Deployment Status
uses: stegzilla/discord-notify@v2
with:
title: New Release!
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
message: |
## ${{ needs.workshopUpload.outputs.title }}
**Details:**
${{ needs.workshopUpload.outputs.body }}
[Full Details](${{ github.event.release.html_url || 'https://github.com/BoldestDungeon/wildermyth-drauven-pcs/releases' }})
include_image: true
avatar_url: https://raw.githubusercontent.com/BoldestDungeon/wildermyth-drauven-pcs/refs/heads/main/.develop/GitHubBotAvatar.png
username: Trava
notify-failure:
needs: workshopUpload
runs-on: ubuntu-latest
environment: deploy
if: always() # We need the steps to always be checked. By default jobs don't run if a previous one has failed. Without this line present, notify-failure would never be able to run.
steps:
- name: Check if previous job failed
if: ${{ needs.workshopUpload.result != 'success' }} # This line actually checks if the build failed. If it failed, then this step will run.
uses: stegzilla/discord-notify@v2
with:
title: "Failed to Deploy `${{ needs.workshopUpload.outputs.title }}`"
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
message: |
**Deployment of release** `${{ needs.workshopUpload.outputs.title }}` **failed!**
Please check the GitHub Actions logs for more details.
include_image: true
avatar_url: https://raw.githubusercontent.com/BoldestDungeon/wildermyth-drauven-pcs/refs/heads/main/.develop/GitHubBotAvatar.png
colour: "#F44336"
username: Trava