name: Build Multi-Platform Docker Images on: push: branches: - main workflow_dispatch: jobs: build: runs-on: ubuntu-latest strategy: matrix: version: - tag: v1.0 app_version: v1.0 buggy: false - tag: v2.0 app_version: v2.0 buggy: false - tag: v2.1 app_version: v2.1 buggy: false - tag: v3.0-buggy app_version: v3.0-buggy buggy: true steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Harbor uses: docker/login-action@v3 with: registry: harbor.seahi.me username: ${{ secrets.HARBOR_USERNAME }} password: ${{ secrets.HARBOR_PASSWORD }} - name: Build and push ${{ matrix.version.tag }} uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/386,linux/arm64 push: true tags: harbor.seahi.me/stu/versions-for-swarm:${{ matrix.version.tag }} build-args: | APP_VERSION=${{ matrix.version.app_version }} BUGGY=${{ matrix.version.buggy }} cache-from: type=registry,ref=harbor.seahi.me/stu/versions-for-swarm:buildcache cache-to: type=registry,ref=harbor.seahi.me/stu/versions-for-swarm:buildcache,mode=max