-
Notifications
You must be signed in to change notification settings - Fork 10
133 lines (116 loc) · 4.44 KB
/
build-containers.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
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
name: Create and publish container images
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for spa container
id: meta-spa
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-spa
tags: |
type=sha
type=raw,value=latest
- name: Build and push spa image
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9
with:
context: spa/.
push: true
tags: ${{ steps.meta-spa.outputs.tags }}
labels: ${{ steps.meta-spa.outputs.labels }}
- name: Extract metadata (tags, labels) for spa-dark container
id: meta-spa-dark
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-spa-dark
tags: |
type=sha
type=raw,value=latest
- name: Build and push spa-dark image
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9
with:
context: spa/.
build-args: |
VITE_APP_GLOBAL_COLOR=#FFF
VITE_APP_GLOBAL_BACKGROUND_COLOR=#000
push: true
tags: ${{ steps.meta-spa-dark.outputs.tags }}
labels: ${{ steps.meta-spa-dark.outputs.labels }}
- name: Extract metadata (tags, labels) for api container
id: meta-api
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api
tags: |
type=sha
type=raw,value=latest
- name: Build and push api image
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9
with:
context: api/.
push: true
tags: ${{ steps.meta-api.outputs.tags }}
labels: ${{ steps.meta-api.outputs.labels }}
- name: Extract metadata (tags, labels) for recommendations container
id: meta-recommendations
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-recommendations
tags: |
type=sha
type=raw,value=latest
- name: Build and push recommendations image
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9
with:
context: .
file: recommendations/Dockerfile
push: true
tags: ${{ steps.meta-recommendations.outputs.tags }}
labels: ${{ steps.meta-recommendations.outputs.labels }}
- name: Extract metadata (tags, labels) for inventory container
id: meta-inventory
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-inventory
tags: |
type=sha
type=raw,value=latest
- name: Build and push inventory image
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9
with:
context: inventory/.
push: true
tags: ${{ steps.meta-inventory.outputs.tags }}
labels: ${{ steps.meta-inventory.outputs.labels }}
- name: Extract metadata (tags, labels) for checkout container
id: meta-checkout
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-checkout
tags: |
type=sha
type=raw,value=latest
- name: Build and push checkout image
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9
with:
context: checkout/.
push: true
tags: ${{ steps.meta-checkout.outputs.tags }}
labels: ${{ steps.meta-checkout.outputs.labels }}