Skip to content

SRVKP-13295,SRVKP-13538: manual cherry-pick of SRVKP-13295 [release-v1.23.x] #1396

SRVKP-13295,SRVKP-13538: manual cherry-pick of SRVKP-13295 [release-v1.23.x]

SRVKP-13295,SRVKP-13538: manual cherry-pick of SRVKP-13295 [release-v1.23.x] #1396

name: Build and Publish Container
on:
push:
branches:
- main
- release-v* # example: release-v1.14
- master
tags: ['v*']
pull_request:
branches:
- main
- master
- release-v*
workflow_dispatch:
jobs:
setup:
name: build container
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout source code
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '22'
- name: Enable Corepack
run: corepack enable
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
- name: Login in to ghcr.io registry
if: github.event_name != 'pull_request'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache node modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
env:
cache-name: cache-node-modules
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Build and push Dynamic Console container image
run: ./scripts/build_container.sh
env:
SUPPORT_MULTI_ARCH: "true"
CONSOLE_PLUGIN_IMAGE_REPO: ${{ github.event_name == 'pull_request' && format('ttl.sh/{0}/console-plugin-pr-{1}', github.repository, github.event.pull_request.number) || format('ghcr.io/{0}', github.repository) }}
CONSOLE_PLUGIN_IMAGE_TAG: ${{ github.event_name == 'pull_request' && '24h' || github.ref_name }}