@@ -11,40 +11,50 @@ permissions:
1111 id-token : write # OIDC
1212
1313jobs :
14- publish-docker-image :
15- timeout-minutes : 20
14+ build-and-push :
15+ timeout-minutes : 30
1616 strategy :
1717 matrix :
1818 include :
1919 - arch : amd64
2020 runner : ubuntu-latest
2121 - arch : arm64
22- runner : ubuntu-24.04-arm64
22+ runner : ubuntu-24.04-arm
2323 runs-on : ${{ matrix.runner }}
2424
2525 steps :
2626 - uses : actions/checkout@v4
2727
28- # Log in so we can push the image layers + tags to Docker Hub
29- - uses : docker/login-action@v2
28+ - name : Extract version from Cargo.toml
29+ id : version
30+ run : echo "version=$(awk -F '"' '/^version =/ {print $2}' Cargo.toml)" >> "$GITHUB_OUTPUT"
31+
32+ - uses : docker/setup-buildx-action@v3
33+
34+ - uses : docker/login-action@v3
3035 with :
3136 username : ${{ vars.DOCKERHUB_USER }}
3237 password : ${{ secrets.DOCKERHUB_WRITE_PASSWORD }}
3338
34- - run : ./scripts/publish-image.sh
35- shell : bash
36- env :
37- ARCH : ${{ matrix.arch }}
39+ - uses : docker/build-push-action@v6
40+ with :
41+ context : .
42+ file : ./Dockerfile
43+ platforms : linux/${{ matrix.arch }}
44+ push : true
45+ tags : farcasterxyz/snapchain:${{ steps.version.outputs.version }}-${{ matrix.arch }}
46+ cache-from : type=gha,scope=build-${{ matrix.arch }}
47+ cache-to : type=gha,mode=max,scope=build-${{ matrix.arch }}
3848
3949 create-manifest :
4050 timeout-minutes : 10
4151 runs-on : ubuntu-latest
42- needs : publish-docker-image
52+ needs : build-and-push
4353
4454 steps :
4555 - uses : actions/checkout@v4
4656
47- - uses : docker/login-action@v2
57+ - uses : docker/login-action@v3
4858 with :
4959 username : ${{ vars.DOCKERHUB_USER }}
5060 password : ${{ secrets.DOCKERHUB_WRITE_PASSWORD }}
0 commit comments