fix: use manual custom API config when env vars are absent #21
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 Multi-Arch Image | |
| on: | |
| push: | |
| branches: [ "main" ] # 只有当你推送到 main 分支时才触发 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| # 关键:这里同时构建 x86 和 ARM 两个版本 | |
| platforms: linux/amd64,linux/arm64 | |
| # 镜像名字会自动变成:ghcr.io/你的用户名/你的仓库名:latest | |
| tags: ghcr.io/wing900/ikunkchat:latest |