Skip to content

Commit 77bc19b

Browse files
committed
chart(release): Update workflow for OCI-based registry publish
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 312e4a5 commit 77bc19b

File tree

3 files changed

+51
-12
lines changed

3 files changed

+51
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ jobs:
127127
retry_wait_seconds: 60
128128
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
129129
- name: Login Docker Hub
130-
run: |
131-
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
132-
helm registry login registry-1.docker.io -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
130+
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
133131
env:
134132
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
135133
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
@@ -160,13 +158,6 @@ jobs:
160158
max_attempts: 3
161159
retry_wait_seconds: 120
162160
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images
163-
- name: Push Helm chart to registry
164-
uses: nick-invision/retry@master
165-
with:
166-
timeout_minutes: 20
167-
max_attempts: 3
168-
retry_wait_seconds: 120
169-
command: make chart_release
170161
- name: Delete previous nightly tag & release if any
171162
uses: dev-drprasad/delete-tag-and-release@master
172163
with:

.github/workflows/helm-chart-release.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,56 @@ on:
1515
required: false
1616
type: string
1717
default: 'false'
18+
skip-test:
19+
description: 'Skip the tests'
20+
required: false
21+
type: boolean
22+
default: false
23+
skip-commit:
24+
description: 'Skip the commit'
25+
required: false
26+
type: boolean
27+
default: false
28+
29+
permissions: write-all
1830

1931
jobs:
2032
helm-chart-test:
33+
if: github.event.inputs.skip-test != 'true'
2134
uses: ./.github/workflows/helm-chart-test.yml
2235
with:
2336
release: ${{ github.event.inputs.release == 'true' }}
2437

2538
release:
2639
needs:
2740
- helm-chart-test
41+
if: (!failure() && !cancelled())
2842
runs-on: ubuntu-latest
2943
permissions: write-all
44+
env:
45+
NAME: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
3046
steps:
3147
- name: Checkout
3248
uses: actions/checkout@main
3349
with:
3450
persist-credentials: false
3551
fetch-depth: 0
52+
- name: Set up environment for building chart
53+
uses: nick-invision/retry@master
54+
with:
55+
timeout_minutes: 10
56+
max_attempts: 3
57+
command: make chart_setup_env
58+
- name: Build Helm chart
59+
uses: nick-invision/retry@master
60+
with:
61+
timeout_minutes: 5
62+
max_attempts: 3
63+
retry_wait_seconds: 10
64+
command: |
65+
SET_VERSION=false make chart_build
66+
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
67+
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
3668
3769
- name: Configure Git
3870
run: |
@@ -42,6 +74,20 @@ jobs:
4274
- name: Get chart release notes (chart_release_notes.md)
4375
run: ./generate_chart_changelog.sh
4476

77+
- name: Login Docker Hub
78+
run: helm registry login registry-1.docker.io -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
79+
env:
80+
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
81+
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
82+
83+
- name: Push Helm chart to registry
84+
uses: nick-invision/retry@master
85+
with:
86+
timeout_minutes: 20
87+
max_attempts: 3
88+
retry_wait_seconds: 120
89+
command: make chart_release
90+
4591
- name: Run chart-releaser
4692
uses: helm/chart-releaser-action@main
4793
with:
@@ -52,13 +98,15 @@ jobs:
5298
CR_RELEASE_NOTES_FILE: RELEASE_NOTES.md
5399

54100
- name: Commit files
101+
if: github.event.inputs.skip-commit != 'true'
55102
run: |
56103
git config --local user.email "[email protected]"
57104
git config --local user.name "Selenium CI Bot"
58105
git commit -m "Update tag in docs and files" -a || true
59106
60107
- name: Push changes
108+
if: github.event.inputs.skip-commit != 'true'
61109
uses: ad-m/github-push-action@master
62110
with:
63-
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
111+
github_token: ${{ secrets.SELENIUM_CI_TOKEN || secrets.GITHUB_TOKEN }}
64112
branch: trunk

charts/selenium-grid/.helmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
*.tmproj
2323
.vscode/
2424
ci/
25-
certs/*-helper.sh
25+
certs/add-*-helper.sh

0 commit comments

Comments
 (0)