diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index fd5e508..f3b52c6 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -13,7 +13,7 @@ on: jobs: linux: - name: Build for ARMv6 and ARMv7 + name: Build for ARMv6 (compatible with v7 and Aarch64), and push to Dockerhub runs-on: ubuntu-latest steps: @@ -27,3 +27,20 @@ jobs: run: toolchain/toolchain.sh "download_build_libcurl" - name: Build Alertik for armv6 run: toolchain/toolchain.sh "build_alertik_armv6" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: github.event_name == 'push' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image for armv6/v7 and aarch64 + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + platforms: linux/arm/v6, linux/arm/v7, linux/arm64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/alertik:latest