-
Notifications
You must be signed in to change notification settings - Fork 2
123 lines (112 loc) · 3.43 KB
/
Copy pathmain.yml
File metadata and controls
123 lines (112 loc) · 3.43 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: .NET Core
on: [push]
env:
IMAGE_NAME: atemserver
jobs:
build-win10:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v1
with:
path: client/node_modules
key: ${{ runner.OS }}-client-${{ hashFiles('**/client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-client-
${{ runner.OS }}-
- name: Build with dotnet
run: |
cd AtemServer
dotnet publish -o "$(pwd)/dist" -c Release -r win10-x64
- name: Archive production artifacts
uses: actions/upload-artifact@v1
with:
name: AtemServer-win10
path: AtemServer/dist
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v1
with:
path: client/node_modules
key: ${{ runner.OS }}-client-${{ hashFiles('**/client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-client-
${{ runner.OS }}-
- name: Build with dotnet
run: |
cd AtemServer
dotnet publish -o "$(pwd)/dist" -c Release -r linux-x64
- name: Archive production artifacts
uses: actions/upload-artifact@v1
with:
name: AtemServer-linux
path: AtemServer/dist
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v1
with:
path: client/node_modules
key: ${{ runner.OS }}-docker-${{ hashFiles('**/client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-docker-
${{ runner.OS }}-
- name: Build with dotnet
run: |
cd AtemServer
dotnet publish -o "$(pwd)/dist" -c Release
- name: Build Docker Image
run: |
docker build -t atemserver-image .
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
REPOSITORY=$(echo "${{ github.repository }}" | awk '{print tolower($0)}')
IMAGE_ID=docker.pkg.github.com/$REPOSITORY/$IMAGE_NAME
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag atemserver-image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION