-
Notifications
You must be signed in to change notification settings - Fork 200
72 lines (62 loc) · 2.32 KB
/
server-main.yml
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
name: Server (.NET) - Main
on: workflow_dispatch
jobs:
deploy-netfx:
strategy:
matrix:
include:
- name: 'WebApp Server / Default'
package: WebApp.Server.zip
app: sharplab
url: https://sharplab.io
environment: main-server
- name: x64
package: Server.zip
app: sl-a-core-x64
url: https://sl-a-core-x64.azurewebsites.net/status
environment: main-server-x64
- name: '.NET Framework, x86'
package: Server.NetFramework.zip
app: sl-a-netfx
url: https://sl-a-netfx.azurewebsites.net/status
environment: main-server-netfx
- name: '.NET Framework, x64'
package: Server.NetFramework.zip
app: sl-a-netfx-x64
url: https://sl-a-netfx-x64.azurewebsites.net/status
environment: main-server-netfx-x64
name: 'Deploy to Main (${{ matrix.name }})'
runs-on: ubuntu-latest
permissions:
id-token: write
environment: ${{ matrix.environment }}
steps:
- uses: actions/github-script@v6
id: get-release-tag
with:
script: |
return (await github.graphql(`{
repository(name: "SharpLab", owner: "ashmind") {
releases(orderBy: {field: CREATED_AT, direction: DESC}, first: 50) {
edges { node { tagName } }
}
}
}`)).repository.releases.edges
.map(e => e.node.tagName)
.find(t => t.startsWith('server-release-'));
result-encoding: string
- uses: dsaltares/fetch-gh-release-asset@9b9f2b2336797d56925bd755fb9033ece2b37f3c
with:
version: tags/${{ steps.get-release-tag.outputs.result }}
file: ${{ matrix.package }}
- uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: azure/webapps-deploy@v2
with:
app-name: ${{ matrix.app }}
package: ${{ matrix.package }}
- run: Invoke-RestMethod "${{ matrix.url }}" -MaximumRetryCount 10 -RetryIntervalSec 2
shell: pwsh