This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 519
103 lines (87 loc) · 2.74 KB
/
blazor-client.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
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
name: blazor-client
on:
workflow_dispatch:
push:
branches:
- main
paths:
- src/BuildingBlocks/**
- src/Web/**
- .github/workflows/blazor-client.yml
pull_request:
branches:
- main
paths:
- src/BuildingBlocks/**
- src/Web/**
- .github/workflows/blazor-client.yml
env:
SERVICE: blazor-client
IMAGE: blazor.client
DOTNET_VERSION: 7.0.x
USE_DOTNET_PREVIEW: true
jobs:
BuildContainersForPR_Linux:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
include-prerelease: ${{ env.USE_DOTNET_PREVIEW }}
- name: Build
run: |
dotnet restore "src/Web/BlazorClient.Host/BlazorClient.Host.csproj"
cd src/Web/BlazorClient.Host
dotnet build --no-restore
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
include-prerelease: ${{ env.USE_DOTNET_PREVIEW }}
- name: Build
run: |
dotnet restore "src/Web/BlazorClient.Host/BlazorClient.Host.csproj"
cd src/Web/BlazorClient.Host
dotnet build --no-restore
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}