mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
(cherry picked from commit de4edbbf3b47496cf8f4757e7a1f8280862a36de) Signed-off-by: Jack Yu <jack.yu@suse.com> Co-authored-by: Jack Yu <jack.yu@suse.com>
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
name: Build and release Extension Catalog Image to registry
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
registry_target:
|
|
required: true
|
|
type: string
|
|
registry_user:
|
|
required: true
|
|
type: string
|
|
outputs:
|
|
build-extension-catalog-job-status:
|
|
value: ${{ jobs.build-extension-catalog.outputs.build-status }}
|
|
|
|
jobs:
|
|
build-and-push-extension-catalog:
|
|
name: Build container image
|
|
if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
packages: write
|
|
id-token: write
|
|
outputs:
|
|
build-status: ${{ job.status }}
|
|
steps:
|
|
- name: Read Secrets
|
|
uses: rancher-eio/read-vault-secrets@main
|
|
with:
|
|
secrets: |
|
|
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
|
|
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD ;
|
|
|
|
- name: Checkout repository (normal flow)
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Enable Corepack
|
|
run: corepack enable
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name 'github-actions[bot]'
|
|
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ env.DOCKER_USERNAME }}
|
|
password: ${{ env.DOCKER_PASSWORD }}
|
|
|
|
- name: Setup Helm
|
|
uses: azure/setup-helm@v3
|
|
with:
|
|
version: v3.8.0
|
|
|
|
- name: Setup Nodejs with yarn caching
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: yarn
|
|
|
|
- name: Install dependencies
|
|
run: yarn
|
|
|
|
- name: Build and push UI image
|
|
run: |
|
|
publish="yarn publish-pkgs -cp -r ${{ inputs.registry_target }} -o ${{ inputs.registry_user }}"
|
|
$publish |