-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (101 loc) · 3.67 KB
/
web-server-hw.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
name: "web-server (HW)"
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-hw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-hw,mode=max
build-stage-run-sgx-wallet-server-hw:
name: "Build server (HW)"
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-hw
-
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: "Build stage: run-sgx-wallet-server-hw"
uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:web-server"
build-args: 'SGX_MODE=HW'
secrets: |
"sgx-signing-key=${{ secrets.SGX_SIGNING_KEY }}"
target: run-sgx-wallet-server-hw
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-hw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-hw,mode=max
build-stage-run-sgx-wallet-test-hw:
name: "Build tests (HW)"
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-hw (SGX_MODE=HW)"
uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:web-server"
build-args: 'SGX_MODE=HW'
secrets: |
"sgx-signing-key=${{ secrets.SGX_SIGNING_KEY }}"
target: run-sgx-wallet-test-hw
tags: run-sgx-wallet-test-hw
outputs: type=docker,dest=/tmp/run-sgx-wallet-test-hw.tar
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-hw
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-hw,mode=max
-
uses: actions/upload-artifact@v2
with:
name: run-sgx-wallet-test-hw
path: /tmp/run-sgx-wallet-test-hw.tar