Docker Build #379
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: Docker Build | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to build' | |
| required: true | |
| tag_as_latest: | |
| description: 'Tag this version as latest' | |
| type: boolean | |
| default: true | |
| required: false | |
| jobs: | |
| docker: | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: warp-ubuntu-latest-x64-32x # AMD64 WarpBuild 32CPU runner | |
| - platform: linux/arm64 | |
| runner: warp-ubuntu-latest-arm64-32x # ARM64 WarpBuild 32CPU runner | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # WarpBuild remote Docker builders automatically manage Buildx; no local setup required | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract platform info | |
| id: platform | |
| run: | | |
| ARCH=${MATRIX_PLATFORM#*/} | |
| echo "arch=$ARCH" >> $GITHUB_OUTPUT | |
| env: | |
| MATRIX_PLATFORM: ${{ matrix.platform }} | |
| # Add cache metadata extraction | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: sequin/sequin | |
| tags: | | |
| type=semver,pattern={{version}},value=${{ inputs.version }} | |
| ${{ inputs.tag_as_latest == 'true' && 'type=raw,value=latest' || '' }} | |
| - name: Build and push (WarpBuild) | |
| uses: Warpbuilds/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| profile-name: sequin-builder # replace with your WarpBuild builder profile | |
| build-args: | | |
| SELF_HOSTED=1 | |
| RELEASE_VERSION=${{ inputs.version }} | |
| SENTRY_DSN=${{ secrets.SELF_HOSTED_SENTRY_DSN }} | |
| tags: | | |
| sequin/sequin:${{ inputs.version }}-${{ steps.platform.outputs.arch }} | |
| provenance: false | |
| sbom: false | |
| env: | |
| DOCKER_BUILD_RECORD_UPLOAD: false | |
| DOCKER_BUILD_SUMMARY: false | |
| DOCKER_BUILD_CHECKS_ANNOTATIONS: false | |
| smoke-test: | |
| needs: docker | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Pull and test AMD64 image | |
| env: | |
| IMAGE_VERSION: ${{ inputs.version }}-amd64 | |
| run: .github/workflows/docker-smoke.sh | |
| create-manifest: | |
| needs: smoke-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Create and push manifest | |
| run: | | |
| docker buildx imagetools create -t sequin/sequin:${{ inputs.version }} \ | |
| sequin/sequin:${{ inputs.version }}-amd64 \ | |
| sequin/sequin:${{ inputs.version }}-arm64 | |
| if [[ "${{ inputs.tag_as_latest }}" == "true" ]]; then | |
| docker buildx imagetools create -t sequin/sequin:latest \ | |
| sequin/sequin:${{ inputs.version }}-amd64 \ | |
| sequin/sequin:${{ inputs.version }}-arm64 | |
| fi |