diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5427dc1a3d..b96bb25f32 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,8 +2,8 @@ name: Build and push docker images on: push: - branches: - - main + # branches: + # - main workflow_dispatch: jobs: @@ -15,7 +15,6 @@ jobs: [ api, bots, - # dota, eval, eventsub, integrations, @@ -30,6 +29,7 @@ jobs: ytsr, migrations, ] + platform: [linux/arm64, linux/amd64] steps: - uses: actions/checkout@v3 @@ -37,9 +37,10 @@ jobs: id: prep run: | TAG=$(echo $GITHUB_SHA | head -c7) - IMAGE=${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }} + IMAGE=${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}-${{ matrix.platform }} echo ::set-output name=tagged_image::${IMAGE}:${TAG} echo ::set-output name=tag::${TAG} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Set up Docker Buildx id: buildx @@ -67,12 +68,58 @@ jobs: with: builder: ${{ steps.buildx.outputs.name }} cache-from: type=local,src=/tmp/.buildx-cache + platforms: ${{ matrix.platform }} context: . push: true file: ./Dockerfile target: ${{ matrix.application }} tags: | - ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest + ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest-${{ env.PLATFORM_PAIR }} + + create-manifests: + runs-on: [self-hosted] + needs: [backend] + strategy: + matrix: + application: + [ + api, + bots, + eval, + eventsub, + integrations, + parser, + scheduler, + timers, + watched, + websockets, + tokens, + emotes-cacher, + events, + ytsr, + migrations, + ] + + steps: + - uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Login to Container Registry + uses: docker/login-action@v1.14.1 + with: + registry: ${{ secrets.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Create latest manifest and push + run: | + docker manifest create \ + ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest \ + --amend ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest-amd64 \ + --amend ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest-arm64 + docker manifest push ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest frontend: runs-on: ubuntu-latest