diff --git a/.github/workflows/build-and-push-dockerhub.yml b/.github/workflows/build-and-push-dockerhub.yml new file mode 100644 index 00000000..781d863e --- /dev/null +++ b/.github/workflows/build-and-push-dockerhub.yml @@ -0,0 +1,41 @@ +name: docker +on: + push: + tags: + - '*' +jobs: + multi: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/beehive + tag-sha: false + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/tools/release.sh b/tools/release.sh index 4dc0eaec..cb736fa0 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -25,6 +25,19 @@ fi echo "Releasing ${TAG} ..." +# Tag git and push git tag -a -s -m "Release ${TAG}" "${TAG}" git push --tags + +# Run goreleaser goreleaser release --rm-dist + +# Build and push Docker image +DOCKER_REPO="fribbledom/beehive" +docker buildx build \ + --progress plain \ + --platform=linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 \ + -t="$DOCKER_REPO:$TAG" \ + -t="$DOCKER_REPO:latest" \ + --push \ + .