forked from dxatscale/sfpowerscripts
-
Notifications
You must be signed in to change notification settings - Fork 20
190 lines (162 loc) · 4.88 KB
/
release.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
179
180
181
182
183
184
185
186
187
188
# This pipeline builds the sfp cli plugin
# Needs following secrets
# NPM_TOKEN : Token to npm.js for dx@scale scope
# DOCKER_USERNAME : Token to username for ghcr.io for publishing docker
# DOCKER_SECRET: Password/Token for ghcr.io for publishing docker
#
# Needs the following env vars
# The repo name (for docker registry) has to be set in each job due to a limitiation with github actions
# as global vars (non secrets) cant be passed down to other jobs
name: 'Release'
on:
push:
branches:
- main
- feat/docker-test
paths-ignore:
- 'docs/**'
- '**.md'
- 'decision records/**'
- 'demoreel/**'
- 'prerequisites/**'
workflow_dispatch:
# Merge to Develop, create builds
jobs:
build:
name: 'build packages'
uses: ./.github/workflows/buildPackages.yml
with:
version: ${{ github.ref }}
publish: true
environment: build
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
# On successfull creation of packages,(or even if lerna skips), create docker image
build-docker:
name: 'build docker image'
uses: ./.github/workflows/sfp-build-docker.yml
with:
job-environment: 'build-docker'
suffix-tag: ${{ github.run_id }}
repo: 'flxbl-io'
image: 'sfp-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
needs: [ build ]
build-docker-lite:
name: 'build sfp lite docker image'
uses: ./.github/workflows/sfp-build-docker.yml
with:
job-environment: 'build-docker'
suffix-tag: ${{ github.run_id }}
repo: 'flxbl-io'
dockerFileName: 'sfp-lite'
image: 'sfp-lite-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
needs: [ build ]
#Promotion Stages
sfp-alpha:
name: 'sfp alpha'
uses: ./.github/workflows/promotePackage.yml
with:
version: 'alpha'
pathToPackageJson: 'packages/sfp-cli/package.json'
environment: sfp-alpha
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
needs: [ build ]
alpha-docker:
name: 'promote docker to alpha'
uses: ./.github/workflows/sfp-promote-docker.yml
with:
job-environment: 'sfp-alpha-docker'
repo: 'flxbl-io'
new-tag: alpha
image: 'sfp-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
needs: [ build-docker ]
alpha-docker-lite:
name: 'promote docker lite to alpha'
uses: ./.github/workflows/sfp-promote-docker.yml
with:
job-environment: 'sfp-alpha-docker'
repo: 'flxbl-io'
new-tag: alpha
image: 'sfp-lite-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
needs: [ build-docker-lite ]
sfp-beta:
name: 'sfp beta'
uses: ./.github/workflows/promotePackage.yml
with:
version: 'beta'
pathToPackageJson: 'packages/sfp-cli/package.json'
environment: sfp-beta
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
needs: [ build ]
beta-docker:
name: 'promote docker to beta'
uses: ./.github/workflows/sfp-promote-docker.yml
with:
job-environment: 'sfp-beta-docker'
repo: 'flxbl-io'
new-tag: beta
image: 'sfp-lite-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
needs: [ build-docker ]
beta-docker-lite:
name: 'promote docker light to beta'
uses: ./.github/workflows/sfp-promote-docker.yml
with:
job-environment: 'sfp-beta-docker'
repo: 'flxbl-io'
new-tag: beta
image: 'sfp-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
needs: [ build-docker-lite ]
sfp-prod:
name: 'sfp prod'
uses: ./.github/workflows/promotePackage.yml
with:
version: 'latest'
pathToPackageJson: 'packages/sfp-cli/package.json'
environment: sfp-prod
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
needs: [ build ]
prod-docker:
name: 'copy rc docker to prod'
uses: ./.github/workflows/sfp-copy-docker.yml
with:
job-environment: 'sfp-prod-docker'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
signing_secret: ${{ secrets.SIGNING_SECRET }}
cosign_password: ${{ secrets.COSIGN_PASSWORD }}
needs: [ build-docker ]
prod-docker-lite:
name: 'copy rc lite docker to prod'
uses: ./.github/workflows/sfp-copy-docker.yml
with:
job-environment: 'sfp-prod-docker'
image: sfp-lite-rc
image-as: sfp-lite
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
signing_secret: ${{ secrets.SIGNING_SECRET }}
cosign_password: ${{ secrets.COSIGN_PASSWORD }}
needs: [ build-docker-lite ]