diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6e8052b..03b0c86 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,22 +19,21 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=kainlite/tr-gh - SHORTREF=${GITHUB_SHA::8} - TAG="${DOCKER_IMAGE}:${SHORTREF}" - echo tag=${TAG} >> ${GITHUB_OUTPUT} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up containerd + uses: crazy-max/ghaction-setup-containerd@v2 - - name: Build and push + - name: Build Docker image uses: docker/build-push-action@v6 with: - push: true - tags: ${{ steps.prep.outputs.tag }} + context: . + platforms: linux/amd64,linux/arm64 + tags: docker.io/kainlite/tr-gh:latest + outputs: type=oci,dest=/tmp/image.tar + + - name: Import image in containerd + run: | + sudo ctr i import --base-name docker.io/kainlite/tr-gh --digests --all-platforms /tmp/image.tar + + - name: Push image with containerd + run: | + sudo ctr --debug i push --user "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" docker.io/kainlite/tr-gh:latest