chore: update proform to v1.3.34 #98
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: ci | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_client_dist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3.0.0 | |
with: | |
version: 8 | |
- run: pnpm install | |
- name: build arco web | |
run: pnpm build:arco-vue | |
- name: Upload build dist artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: client_dist | |
path: ./packages/web/dist | |
build_server_dist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3.0.0 | |
with: | |
version: 8 | |
- run: pnpm install | |
- name: build server | |
run: pnpm build:server | |
- name: Upload build dist artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server_dist | |
path: ./packages/server/dist | |
magic_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- id: generate | |
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
outputs: | |
VERSION: ${{ steps.generate.outputs.VERSION }} | |
build_client_image: | |
needs: [build_client_dist, magic_version] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: client_dist | |
path: ./ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: "yiwwhl/harbor-design:${{ needs.magic_version.outputs.VERSION }}" | |
build_server_image: | |
needs: [build_server_dist, magic_version] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: server_dist | |
path: ./ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./packages/server | |
push: true | |
tags: "yiwwhl/harbor-design-server:${{ needs.magic_version.outputs.VERSION }}" | |
gitops: | |
runs-on: ubuntu-latest | |
needs: [magic_version, build_client_image, build_server_image] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: trigger gitops | |
run: | | |
git clone https://yiwwhl:${{ secrets.GH_TOKEN }}@github.com/yiwwhl/IaC.git -b main --single-branch --depth 1 iac | |
cd iac | |
git config --global user.name "yiwwhl" | |
git config --global user.email "yiwwhl@qq.com" | |
[ -f $IAC_TARGET/$IAC_TARGET_WEB_FILE.yaml.bak ] && mv $IAC_TARGET/$IAC_TARGET_WEB_FILE.yaml.bak $IAC_TARGET/$IAC_TARGET_WEB_FILE.yaml | |
sed -i "s|image:.*|image: $IMAGE_TAG|g" $IAC_TARGET/$IAC_TARGET_WEB_FILE.yaml | |
[ -f $IAC_TARGET/$IAC_TARGET_SERVER_FILE.yaml.bak ] && mv $IAC_TARGET/$IAC_TARGET_SERVER_FILE.yaml.bak $IAC_TARGET/$IAC_TARGET_SERVER_FILE.yaml | |
sed -i "s|image:.*|image: $IMAGE_SERVER_TAG|g" $IAC_TARGET/$IAC_TARGET_SERVER_FILE.yaml | |
git add . | |
git commit -m "chore: deploy ${{ needs.magic_version.outputs.VERSION }} to $IAC_TARGET" | |
git push https://yiwwhl:${{ secrets.GH_TOKEN }}@github.com/yiwwhl/IaC.git | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
IAC_TARGET: "harbor-design" | |
IAC_TARGET_WEB_FILE: "web" | |
IAC_TARGET_SERVER_FILE: "server" | |
IMAGE_TAG: "yiwwhl/harbor-design:${{ needs.magic_version.outputs.VERSION }}" | |
IMAGE_SERVER_TAG: "yiwwhl/harbor-design-server:${{ needs.magic_version.outputs.VERSION }}" |