Merge pull request #1 from ROOMrepair/main #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |