diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 79336f0..443c2de 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,5 +22,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: docker/setup-buildx-action@v3 - run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - - run: tools/docker.sh "linux/amd64,linux/arm64" + - run: tools/docker.sh diff --git a/tools/docker.sh b/tools/docker.sh index 6e9c181..29b7509 100755 --- a/tools/docker.sh +++ b/tools/docker.sh @@ -2,30 +2,10 @@ set -e -check_buildx(){ - docker buildx version &>/dev/null - return $? -} - -build_image() { - local platforms=${1:-} - if [ ! -z "$platforms" ] && check_buildx; then - echo "Building for platforms: $platforms" - # Build for each git tag and latest - for tag in latest $(git tag --points-at | sed s/^v//); do - docker buildx build \ - --platform "$platforms" \ - --tag raviqqe/muffet:$tag \ - --push \ - . - done - else - for tag in latest $(git tag --points-at | sed s/^v//); do - docker build -t raviqqe/muffet:$tag . - docker push raviqqe/muffet:$tag - done - fi -} - - -build_image "$@" \ No newline at end of file +for tag in latest $(git tag --points-at | sed s/^v//); do + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --tag raviqqe/muffet:$tag \ + --push \ + . +done