name: Build and Push Docker image on: push: branches: - main permissions: contents: write jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v4 # Auto Tag: generates next semantic version (v1.0.0, v1.1.0, etc.) - name: Auto Tag id: autotag uses: phish108/autotag-action@v1.1.64 with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Log in to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 # Multiarch Docker build and push with BOTH version tag and latest - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . push: true platforms: linux/amd64,linux/arm64 tags: | ${{ secrets.DOCKERHUB_USERNAME }}/moocup:${{ steps.autotag.outputs.tag }} ${{ secrets.DOCKERHUB_USERNAME }}/moocup:latest