Update mock_server.py #28
This file contains hidden or 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 Docker image | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - v1 | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: docker-dashscope-proxy-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_image: | |
| name: Push Docker image | |
| runs-on: ubuntu-latest | |
| # 保持原有的权限检查,如果不是在该 organization 下运行请移除此行 | |
| if: github.repository_owner == 'siliconflow' | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| username: caishenghang | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| VERSION=${{ github.ref_name }} | |
| else | |
| # 使用前 7 位 commit hash 作为短版本号 | |
| VERSION=$(echo ${{ github.sha }} | cut -c1-7) | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| caishenghang/dashscope-proxy:latest | |
| caishenghang/dashscope-proxy:${{ steps.get_version.outputs.version }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |