-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.71 KB
/
azure-release.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
name: Build and Release
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Check for outdated packages
run: |
dotnet tool install --global dotnet-outdated-tool
dotnet outdated
- name: Update build info
run: |
cd Server
sed -i "s/@@GIT_HASH@@/$GITHUB_SHA/" BuildInfo.cs
sed -i "s/@@BUILD_TIME@@/$(date +%s)/" BuildInfo.cs
- name: Publish
run: dotnet publish --configuration Release -o built
- name: Install zopfli
run: sudo apt install -y zopfli
- name: Ahead-of-time compress static assets
run: |
shopt -s globstar
shopt -s extglob
cd built/wwwroot
zopfli --i50 **/*.!(*@(png|gz|br))
brotli -k --best **/*.!(*@(png|gz|br))
- name: Azure Login
uses: Azure/login@v1
if: "!contains(github.event.head_commit.message, 'norelease') && github.ref == 'refs/heads/princess'"
with:
# Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS
creds: ${{secrets.AZURE_CREDENTIALS}}
- name: Azure WebApp
uses: Azure/webapps-deploy@v2
if: "!contains(github.event.head_commit.message, 'norelease') && github.ref == 'refs/heads/princess'"
with:
# Name of the Azure Web App
app-name: BuzzOffDev
# Applies to Web App only: Path to package or folder. *.zip, *.war, *.jar or a folder to deploy
package: built
# Enter the start up command. For ex. dotnet run or dotnet run
startup-command: dotnet BuzzOff.Server.dll