7
7
- ' *'
8
8
env :
9
9
CACHE_REGISTRY : ghcr.io
10
- CACHE_REPO : redkubes/otomi-core
11
- REPO : otomi/core
12
- GIT_USER : redkubesbot
10
+ CACHE_REPO : linode/apl-core
11
+ REPO : linode/apl-core
12
+ DOCKER_PASSWORD : ${{ secrets.DOCKERHUB_LINODEBOT_TOKEN }}
13
+ DOCKER_USERNAME : ${{ vars.DOCKERHUB_LINODEBOT_USERNAME }}
13
14
14
15
jobs :
15
16
build-test-cache :
16
17
if : (!contains(github.event.head_commit.message, 'ci skip') && !startsWith(github.ref, 'refs/tags/') && !github.event.act)
17
18
runs-on : ubuntu-latest
18
19
env :
19
20
COMMIT_MSG : ${{ github.event.head_commit.message }}
21
+ BOT_EMAIL : ${{ vars.BOT_EMAIL }}
22
+ BOT_USERNAME : ${{ vars.BOT_USERNAME }}
20
23
steps :
21
24
- name : Set env
22
25
run : |
23
26
tag=${GITHUB_REF##*/}
24
27
echo "Creating tag: $tag"
25
28
echo "TAG=$tag" >> $GITHUB_ENV
26
- git config --global user.email [email protected]
27
- git config --global user.name $GIT_USER
29
+ git config --global user.email $BOT_EMAIL
30
+ git config --global user.name $BOT_USERNAME
31
+
28
32
- name : Checkout
29
- uses : actions/checkout@v3
30
- # - name: CI tests, image build and push tag for main or branch
31
- # uses: whoan/docker-build-with-cache-action@v5
32
- # with:
33
- # username: ${{ env.GIT_USER }}
34
- # password: '${{ secrets.NPM_TOKEN }}'
35
- # registry: ${{ env.CACHE_REGISTRY }}
36
- # image_name: ${{ env.CACHE_REPO }}
37
- # image_tag: ${{ env.TAG }}
38
- # pull_image_and_stages: true
33
+ uses : actions/checkout@v4
39
34
- name : Set up Docker Buildx
40
- uses : docker/setup-buildx-action@v2
35
+ uses : docker/setup-buildx-action@v3
41
36
- name : Login to Github Packages
42
- uses : docker/login-action@v2.1.0
37
+ uses : docker/login-action@v3
43
38
with :
44
39
registry : ${{ env.CACHE_REGISTRY }}
45
- username : ${{ env.GIT_USER }}
46
- password : ' ${{ secrets.NPM_TOKEN }}'
40
+ username : ${{ env.BOT_USERNAME }}
41
+ password : ' ${{ secrets.BOT_TOKEN }}'
47
42
- name : CI tests, image build and push tag for main or branch
48
- uses : docker/build-push-action@v3
43
+ uses : docker/build-push-action@v5
49
44
with :
50
45
push : true
51
46
tags : |
@@ -55,15 +50,19 @@ jobs:
55
50
needs : build-test-cache
56
51
if : always() && ((contains(needs.build-test-cache.result, 'success') && !contains(needs.integration.outputs.started, 'true')) || (contains(needs.integration.result, 'success'))) && !github.event.act
57
52
runs-on : ubuntu-latest
53
+ env :
54
+ BOT_EMAIL : ${{ vars.BOT_EMAIL }}
55
+ BOT_USERNAME : ${{ vars.BOT_USERNAME }}
58
56
steps :
59
57
- name : Push to docker hub
60
58
run : |
59
+ set -u
61
60
TAG=${GITHUB_REF##*/}
62
- docker login -u $GIT_USER -p ' ${{ secrets.NPM_TOKEN }}' ghcr.io
61
+ docker login ghcr.io -u $BOT_USERNAME -p ${{ secrets.BOT_TOKEN }}
63
62
image="$CACHE_REGISTRY/$CACHE_REPO:$TAG"
64
63
docker pull $image
65
64
docker tag $image $REPO:$TAG
66
- docker login -u otomi -p ${{ secrets.DOCKERHUB_OTOMI_TOKEN }}
65
+ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
67
66
docker push $REPO:$TAG
68
67
- name : Show me the logic
69
68
run : |
@@ -77,16 +76,16 @@ jobs:
77
76
COMMIT_MSG : ${{ github.event.head_commit.message }}
78
77
steps :
79
78
- name : Checkout
80
- uses : actions/checkout@v3
79
+ uses : actions/checkout@v4
81
80
- name : Set env
82
81
run : |
83
- git config --global user.email $[email protected]
84
- git config --global user.name $GIT_USER
82
+ git config --global user.email $BOT_EMAIL
83
+ git config --global user.name $BOT_USERNAME
85
84
- name : Create and push git tag
86
85
id : git_tag
87
86
run : |
88
87
TAG=${GITHUB_REF##*/}
89
- docker login -u otomi -p ${{ secrets.DOCKERHUB_OTOMI_TOKEN }}
88
+ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
90
89
docker pull $REPO:$TAG
91
90
docker tag $REPO:$TAG $REPO:latest
92
91
docker push $REPO:latest
@@ -95,10 +94,10 @@ jobs:
95
94
echo "Releasing $REPO:$release_tag"
96
95
docker tag $REPO:$TAG $REPO:$release_tag
97
96
docker push $REPO:$release_tag
98
- docker login -u $GIT_USER -p '${{ secrets.NPM_TOKEN }}' ghcr.io
97
+ docker login -u $BOT_USERNAME -p '${{ secrets.BOT_TOKEN }}' ghcr.io
99
98
docker tag $REPO:$TAG $CACHE_REGISTRY/$CACHE_REPO:$release_tag
100
99
docker push $CACHE_REGISTRY/$CACHE_REPO:$release_tag
101
- echo "machine github.com login $GIT_USER password ${{ secrets.GIT_PASSWORD }}" > ~/.netrc
100
+ echo "machine github.com login ${{ env.BOT_USERNAME }} password ${{ secrets.BOT_TOKEN }}" > ~/.netrc
102
101
git tag -am "$COMMIT_MSG" $release_tag && git push --follow-tags
103
102
#Cut the CHANGELOG.md file up to the first occurence of the "### \[[0-9]*" (meaning three #, a space,a square bracket and any number after it)
104
103
sed -n '/### \[[0-9]*/q;p' CHANGELOG.md > NEW_CHANGELOG.md
@@ -116,16 +115,16 @@ jobs:
116
115
if : always() && contains(needs.release.result, 'success') && !github.event.act
117
116
runs-on : ubuntu-latest
118
117
container :
119
- image : otomi/ tools:v1 .4.20
118
+ image : linode/apl- tools:v2 .4.0
120
119
options : --user 0
121
120
steps :
122
121
- name : Checkout
123
- uses : actions/checkout@v3
122
+ uses : actions/checkout@v4
124
123
- name : Prepare chart
125
124
id : prepare_chart
126
125
run : |
127
126
# Install and update helm repo
128
- helm repo add otomi https://otomi. io/otomi -core
127
+ helm repo add apl https://linode.github. io/apl -core
129
128
helm repo update
130
129
131
130
# Retrieve the app version from package.json
@@ -150,22 +149,22 @@ jobs:
150
149
)
151
150
152
151
# Update Chart.yaml and values.yaml with the new app version
153
- sed -i "s/0.0.0-chart-version/$app_version/g" chart/otomi /Chart.yaml
154
- sed -i "s/APP_VERSION_PLACEHOLDER/v$app_version/g" chart/otomi /Chart.yaml
152
+ sed -i "s/0.0.0-chart-version/$app_version/g" chart/apl /Chart.yaml
153
+ sed -i "s/APP_VERSION_PLACEHOLDER/v$app_version/g" chart/apl /Chart.yaml
155
154
156
155
echo "Chart and values files updated successfully with version $app_version"
157
156
158
157
# Copy readme from repo into the charts and add tpl/chart-values.md
159
- cp README.md chart/otomi /
160
- printf "\n\n" >>chart/otomi /README.md
161
- cat tpl/chart-values.md >>chart/otomi /README.md
158
+ cp README.md chart/apl /
159
+ printf "\n\n" >>chart/apl /README.md
160
+ cat tpl/chart-values.md >>chart/apl /README.md
162
161
163
162
# Generate schema
164
- npx js-yaml values-schema.yaml > chart/otomi /values.schema.json
163
+ npx js-yaml values-schema.yaml > chart/apl /values.schema.json
165
164
166
165
# Set the global id for git as it seems needed by the next step when a custom image is used
167
- git config --global user.email $[email protected]
168
- git config --global user.name $GIT_USER
166
+ git config --global user.email ${{ env.BOT_EMAIL }}
167
+ git config --global user.name ${{ env.BOT_USERNAME }}
169
168
- name : Create and publish otomi chart release
170
169
id : chart_release
171
170
@@ -194,7 +193,7 @@ jobs:
194
193
- name : Pulling the helm chart
195
194
run : |
196
195
# Install and update helm repo
197
- helm repo add otomi https://otomi. io/otomi -core
196
+ helm repo add apl https://linode.github. io/apl -core
198
197
helm repo update
199
198
200
199
# Get latest version of otomi
@@ -225,7 +224,7 @@ jobs:
225
224
region=nl-ams \
226
225
project-id=${{ secrets.SCW_DEFAULT_PROJECT_ID }} \
227
226
--wait
228
- echo "CLuster deployed successfully"
227
+ echo "Cluster deployed successfully"
229
228
- name : Installing new otomi release
230
229
run : |
231
230
# Get cluster ID and set env var
@@ -277,36 +276,3 @@ jobs:
277
276
SLACK_ICON : https://github.com/redkubes.png?size=48
278
277
SLACK_TITLE : CI run
279
278
SLACK_USERNAME : RedKubesBot
280
-
281
- execute-aws-marketplace :
282
- name : AWS Dispatch
283
- needs : chart-release
284
- if : always() && contains(needs.chart-release.result, 'success') && !github.event.act
285
- runs-on : ubuntu-latest
286
- steps :
287
- - uses : actions/github-script@v6
288
- with :
289
- github-token : ${{ secrets.ACTIONS_KEY }}
290
- script : |
291
- await github.rest.actions.createWorkflowDispatch({
292
- owner: 'redkubes',
293
- repo: 'aws-marketplace',
294
- workflow_id: 'deploy_release.yaml',
295
- ref: 'main'
296
- })
297
- execute-azure-marketplace :
298
- name : Azure Dispatch
299
- needs : chart-release
300
- if : always() && contains(needs.chart-release.result, 'success') && !github.event.act
301
- runs-on : ubuntu-latest
302
- steps :
303
- - uses : actions/github-script@v6
304
- with :
305
- github-token : ${{ secrets.ACTIONS_KEY }}
306
- script : |
307
- await github.rest.actions.createWorkflowDispatch({
308
- owner: 'redkubes',
309
- repo: 'azure-marketplace',
310
- workflow_id: 'deploy_release.yaml',
311
- ref: 'main'
312
- })
0 commit comments