Skip to content

Commit

Permalink
chart(release): Update workflow for OCI-based registry publish
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Aug 12, 2024
1 parent 312e4a5 commit 77bc19b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ jobs:
retry_wait_seconds: 60
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
- name: Login Docker Hub
run: |
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
helm registry login registry-1.docker.io -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
Expand Down Expand Up @@ -160,13 +158,6 @@ jobs:
max_attempts: 3
retry_wait_seconds: 120
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images
- name: Push Helm chart to registry
uses: nick-invision/retry@master
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 120
command: make chart_release
- name: Delete previous nightly tag & release if any
uses: dev-drprasad/delete-tag-and-release@master
with:
Expand Down
50 changes: 49 additions & 1 deletion .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,56 @@ on:
required: false
type: string
default: 'false'
skip-test:
description: 'Skip the tests'
required: false
type: boolean
default: false
skip-commit:
description: 'Skip the commit'
required: false
type: boolean
default: false

permissions: write-all

jobs:
helm-chart-test:
if: github.event.inputs.skip-test != 'true'
uses: ./.github/workflows/helm-chart-test.yml
with:
release: ${{ github.event.inputs.release == 'true' }}

release:
needs:
- helm-chart-test
if: (!failure() && !cancelled())
runs-on: ubuntu-latest
permissions: write-all
env:
NAME: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
steps:
- name: Checkout
uses: actions/checkout@main
with:
persist-credentials: false
fetch-depth: 0
- name: Set up environment for building chart
uses: nick-invision/retry@master
with:
timeout_minutes: 10
max_attempts: 3
command: make chart_setup_env
- name: Build Helm chart
uses: nick-invision/retry@master
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 10
command: |
SET_VERSION=false make chart_build
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
- name: Configure Git
run: |
Expand All @@ -42,6 +74,20 @@ jobs:
- name: Get chart release notes (chart_release_notes.md)
run: ./generate_chart_changelog.sh

- name: Login Docker Hub
run: helm registry login registry-1.docker.io -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}

- name: Push Helm chart to registry
uses: nick-invision/retry@master
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 120
command: make chart_release

- name: Run chart-releaser
uses: helm/chart-releaser-action@main
with:
Expand All @@ -52,13 +98,15 @@ jobs:
CR_RELEASE_NOTES_FILE: RELEASE_NOTES.md

- name: Commit files
if: github.event.inputs.skip-commit != 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "Selenium CI Bot"
git commit -m "Update tag in docs and files" -a || true
- name: Push changes
if: github.event.inputs.skip-commit != 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
github_token: ${{ secrets.SELENIUM_CI_TOKEN || secrets.GITHUB_TOKEN }}
branch: trunk
2 changes: 1 addition & 1 deletion charts/selenium-grid/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
*.tmproj
.vscode/
ci/
certs/*-helper.sh
certs/add-*-helper.sh

0 comments on commit 77bc19b

Please sign in to comment.