Skip to content

Commit

Permalink
Merge pull request #1 from ROOMrepair/main
Browse files Browse the repository at this point in the history
add new workflow
  • Loading branch information
pixiake authored Dec 20, 2024
2 parents 8ed77bd + dfa6741 commit 48ae722
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-push-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: build-push-dashboard

on:
push:
branches:
- main
tags:
- '*'

jobs:
build-dashboard:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup-node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: install-pnpm
run: |
npm install -g pnpm
- name: install-dependencies
run: |
cd ui/ && pnpm install
- name: build-dashboard
run: |
pnpm run dashboard:build
- name: upload-dashboard
uses: actions/upload-artifact@v4
with:
name: dashboard
path: ui/apps/dashboard/dist


build-and-push-dashboard-image:
runs-on: ubuntu-latest
needs: [build-dashboard]
steps:
- name: set-version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION="1.0.6"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.6'
- name: setup-docker
uses: docker/setup-buildx-action@v4
- name: download-dashboard
uses: actions/download-artifact@v4
with:
name: dashboard
path: ui/apps/dashboard/dist
- name: tree
run: |
ls ui/apps/dashboard/dist
- name: build-dashboard-image
run: |
make image-karmada-dashboard-web GOARCH=amd64
- name: login-docker
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: tag-and-push-image
run: |
docker tag karmada/karmada-dashboard-web:main kubesphere/karmada-dashboard-web:${{ env.VERSION }}
docker push kubesphere/karmada-dashboard-web:${{ env.VERSION }}

0 comments on commit 48ae722

Please sign in to comment.