-
Notifications
You must be signed in to change notification settings - Fork 14
154 lines (144 loc) · 4.7 KB
/
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Workflow to build containers
---
name: containers
on:
workflow_dispatch:
push:
branches:
- "main"
- "staging"
# Pattern matched against refs/tags
tags:
- '**'
paths-ignore:
- 'docs/**'
- 'infrastructure/**'
pull_request:
branches:
- "main"
- "staging"
paths-ignore:
- 'docs/**'
- 'infrastructure/**'
# Only run one at a time
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
########## Backend container ##################################
changes-backend:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.backend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'go.mod'
- 'go.sum'
- 'main.go'
- 'Dockerfile'
- 'gateway/**'
- 'cmd/**'
- 'internal/**'
- 'pkg/**'
- 'backend/**'
backend:
needs: changes-backend
if: ${{ needs.changes-backend.outputs.changes == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/docker.yml
with:
name: backend
deploy-environment: 'stg'
secrets: inherit
########## IPFS container ##################################
changes-ipfs:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.ipfs }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ipfs:
- 'docker/images/ipfs/**'
ipfs:
needs: changes-ipfs
if: ${{ needs.changes-ipfs.outputs.changes == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/docker.yml
with:
name: ipfs
context: docker/images/ipfs
secrets: inherit
########## Receptor container ##################################
changes-receptor:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.receptor }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
receptor:
- 'receptor/**'
receptor:
needs: changes-receptor
if: ${{ needs.changes-receptor.outputs.changes == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/docker.yml
with:
name: receptor
context: receptor
secrets: inherit
################ Frontend container ##############################
changes-frontend:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
frontend:
- 'frontend/**'
frontend:
needs: changes-frontend
if: ${{ needs.changes-frontend.outputs.changes == 'true' || github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
backends: [
{ env: stg, url: 'https://api.stg.labdao.xyz', gateway: 'https://ipfs.stg.labdao.xyz/ipfs/', frontend-url: 'https://app.stg.labdao.xyz', demo-url: 'https://app.stg.labdao.xyz/experiments/268'},
{ env: prod, url: 'https://api.prod.labdao.xyz', gateway: 'http://ipfs.prod.labdao.xyz/ipfs/', frontend-url: 'https://app.prod.labdao.xyz', demo-url: 'https://app.prod.labdao.xyz/experiments/3062'},
{ env: lbbprod, url: 'https://api.lab.bio', gateway: 'https://ipfs.lab.bio/ipfs/', frontend-url: 'https://app.lab.bio', demo-url: 'https://app.lab.bio/experiments/201'},
{ env: test, url: 'https://test-api.lab.bio', gateway: 'https://test-ipfs.lab.bio/ipfs/', frontend-url: 'https://test-app.lab.bio', demo-url: 'https://test-app.lab.bio/experiments/201'},
{ env: local, url: 'http://localhost:8080', gateway: 'http://localhost:8888/ipfs/', frontend-url: 'http://localhost:3000', demo-url: 'http://localhost:3000/experients/1'}
]
uses: ./.github/workflows/docker.yml
with:
name: frontend
context: frontend
tag-suffix: -${{ matrix.backends.env }}
build-args: |
NEXT_PUBLIC_BACKEND_URL=${{ matrix.backends.url }}
NEXT_PUBLIC_IPFS_GATEWAY_ENDPOINT=${{ matrix.backends.gateway }}
NEXT_PUBLIC_FRONTEND_URL=${{ matrix.backends.frontend-url }}
NEXT_PUBLIC_DEMO_URL=${{ matrix.backends.demo-url }}
deploy-environment: ${{ matrix.backend.env }}
secrets: inherit