-
Notifications
You must be signed in to change notification settings - Fork 368
178 lines (159 loc) · 5.69 KB
/
platform-docker-build-test-publish.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Platform Build Docker Images, Test, and Publish
on:
push:
branches:
- main
release:
types:
- released
jobs:
docker-build-api:
name: Build API Image
uses: ./.github/workflows/.reusable-docker-build.yml
with:
target: oss-api
image-name: flagsmith-api
docker-build-frontend:
name: Build Frontend Image
uses: ./.github/workflows/.reusable-docker-build.yml
with:
target: oss-frontend
image-name: flagsmith-frontend
docker-build-unified:
name: Build Unified Image
uses: ./.github/workflows/.reusable-docker-build.yml
with:
target: oss-unified
image-name: flagsmith
docker-build-private-cloud-api:
name: Build Private Cloud API Image
uses: ./.github/workflows/.reusable-docker-build.yml
with:
target: private-cloud-api
image-name: flagsmith-private-cloud-api
secrets:
secrets: |
github_private_cloud_token=${{ secrets.GH_PRIVATE_ACCESS_TOKEN }}
docker-build-private-cloud:
name: Build Private Cloud Image
uses: ./.github/workflows/.reusable-docker-build.yml
with:
target: private-cloud-unified
image-name: flagsmith-private-cloud
secrets:
secrets: |
github_private_cloud_token=${{ secrets.GH_PRIVATE_ACCESS_TOKEN }}
docker-build-e2e:
name: Build E2E Image
uses: ./.github/workflows/.reusable-docker-build.yml
with:
file: frontend/Dockerfile.e2e
image-name: flagsmith-e2e
scan: false
run-e2e-tests:
needs: [docker-build-api, docker-build-private-cloud-api, docker-build-e2e]
uses: ./.github/workflows/.reusable-docker-e2e-tests.yml
with:
e2e-image: ${{ needs.docker-build-e2e.outputs.image }}
api-image: ${{ matrix.api-image }}
concurrency: ${{ matrix.args.concurrency }}
tests: ${{ matrix.args.tests }}
secrets: inherit
strategy:
matrix:
api-image:
- ${{ needs.docker-build-api.outputs.image }}
- ${{ needs.docker-build-private-cloud-api.outputs.image }}
args:
- tests: segment-part-1 environment
concurrency: 1
- tests: segment-part-2
concurrency: 1
- tests: segment-part-3 signup flag invite project
concurrency: 2
- tests: versioning
concurrency: 1
docker-publish-api:
needs: [docker-build-api, run-e2e-tests]
uses: ./.github/workflows/.reusable-docker-publish.yml
if: github.event_name == 'release'
with:
source-images: ${{ needs.docker-build-api.outputs.image }}
target-images: flagsmith/flagsmith-api
secrets: inherit
docker-publish-frontend:
needs: [docker-build-frontend, run-e2e-tests]
uses: ./.github/workflows/.reusable-docker-publish.yml
if: github.event_name == 'release'
with:
source-images: ${{ needs.docker-build-frontend.outputs.image }}
target-images: flagsmith/flagsmith-frontend
secrets: inherit
docker-publish-unified:
needs: [docker-build-unified, run-e2e-tests]
uses: ./.github/workflows/.reusable-docker-publish.yml
if: github.event_name == 'release'
with:
source-images: ${{ needs.docker-build-unified.outputs.image }}
target-images: flagsmith/flagsmith
secrets: inherit
docker-publish-private-cloud-api:
needs: [docker-build-private-cloud-api, run-e2e-tests]
uses: ./.github/workflows/.reusable-docker-publish.yml
if: github.event_name == 'release'
with:
source-images: ${{ needs.docker-build-private-cloud-api.outputs.image }}
target-images: flagsmith/flagsmith-private-cloud-api
secrets: inherit
docker-publish-private-cloud:
needs: [docker-build-private-cloud, run-e2e-tests]
uses: ./.github/workflows/.reusable-docker-publish.yml
if: github.event_name == 'release'
with:
source-images: ${{ needs.docker-build-private-cloud.outputs.image }}
target-images: flagsmith/flagsmith-private-cloud
secrets: inherit
update-charts:
needs: [docker-publish-api, docker-publish-frontend, docker-publish-unified]
runs-on: ubuntu-latest
steps:
- name: Checkout Target Charts Repository to update yaml
uses: actions/checkout@v4
with:
repository: flagsmith/flagsmith-charts
path: chart
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up release tag variables
id: version-trim
run: |
TAG=${{github.ref_name}}
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Run YAML to Github Output Action
id: yaml-output
uses: christian-ci/action-yaml-github-output@v2
with:
file_path: './chart/charts/flagsmith/Chart.yaml'
- uses: us-ignite/action-bump-semver@main
id: bump-semver
with:
current_version: ${{ steps.yaml-output.outputs.version }}
level: minor
- name: Update flagsmith-charts values.yaml with latest docker version
uses: fjogeleit/yaml-update-action@main
with:
token: ${{ secrets.FLAGSMITH_CHARTS_GITHUB_TOKEN }}
repository: flagsmith/flagsmith-charts
workDir: chart
masterBranchName: 'main'
targetBranch: 'main'
branch: docker-image-version-bump-${{ steps.version-trim.outputs.version }}
commitChange: true
createPR: true
message: 'Flagsmith docker image version bump'
description: 'Automated PR generated by a release event in https://github.com/Flagsmith/flagsmith'
valueFile: 'charts/flagsmith/Chart.yaml'
changes: |
{
"appVersion": "${{ steps.version-trim.outputs.version }}",
"version": "${{ steps.bump-semver.outputs.new_version }}"
}