-
Notifications
You must be signed in to change notification settings - Fork 4
154 lines (145 loc) · 5.11 KB
/
web-server-sw.yaml
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: "web-server (SW)"
on: push
# New pushes cancel in-progress builds.
concurrency:
group: ${{ github.workflow }} - ${{ github.job }} - ${{ github.ref }}
cancel-in-progress: true
# Action docs:
#
# - https://github.com/docker/build-push-action#readme
# - https://github.com/docker/login-action#readme
# - https://github.com/docker/metadata-action#readme
# - https://github.com/docker/setup-buildx-action#readme
#
# For the context paths, see:
#
# - Feature request: Allow specifying subdirectory with default git context #460
# https://github.com/docker/build-push-action/issues/460
jobs:
build-stage-web-server-builder:
name: "Builder"
runs-on: ubuntu-latest
steps:
-
uses: docker/setup-buildx-action@v1
-
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: "Build stage: web-server-builder"
uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:web-server"
target: web-server-builder
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max
build-stage-run-sgx-wallet-server-sw:
name: "Build server (SW)"
runs-on: ubuntu-latest
needs: build-stage-web-server-builder
steps:
-
uses: docker/setup-buildx-action@v1
-
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository_owner }}/sgx-wallet-sw
-
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: "Build stage: run-sgx-wallet-server-sw"
uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:web-server"
build-args: 'SGX_MODE=SW'
secrets: |
"sgx-signing-key=${{ secrets.SGX_SIGNING_KEY }}"
target: run-sgx-wallet-server-sw
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max
build-stage-run-sgx-wallet-test-sw:
name: "Build tests (SW)"
runs-on: ubuntu-latest
needs: build-stage-web-server-builder
steps:
-
uses: docker/setup-buildx-action@v1
-
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: "Build image: run-sgx-wallet-test-sw (SGX_MODE=SW)"
uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:web-server"
build-args: 'SGX_MODE=SW'
secrets: |
"sgx-signing-key=${{ secrets.SGX_SIGNING_KEY }}"
target: run-sgx-wallet-test-sw
tags: run-sgx-wallet-test-sw
outputs: type=docker,dest=/tmp/run-sgx-wallet-test-sw.tar
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max
-
uses: actions/upload-artifact@v2
with:
name: run-sgx-wallet-test-sw
path: /tmp/run-sgx-wallet-test-sw.tar
build-stage-cargo-make-ci:
name: "cargo make (SW)"
runs-on: ubuntu-latest
needs:
- build-stage-run-sgx-wallet-server-sw
- build-stage-run-sgx-wallet-test-sw
steps:
-
uses: docker/setup-buildx-action@v1
-
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: "Build stage: build-cargo-make-ci (SGX_MODE=SW)"
uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:web-server"
build-args: 'SGX_MODE=SW'
target: build-cargo-make-ci
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max
run-stage-sgx-wallet-test-sw:
name: "Run tests (SW)"
runs-on: ubuntu-latest
needs: build-stage-run-sgx-wallet-test-sw
steps:
-
uses: docker/setup-buildx-action@v1
-
uses: actions/download-artifact@v2
with:
name: run-sgx-wallet-test-sw
path: /tmp
-
name: "Load image: run-sgx-wallet-test-sw"
run: |
docker load --input /tmp/run-sgx-wallet-test-sw.tar
-
name: "Run image: run-sgx-wallet-test-sw"
run: |
docker run --rm run-sgx-wallet-test-sw