diff --git a/.github/workflow/docker-build.yml b/.github/workflow/docker-build.yml new file mode 100644 index 0000000..092ceee --- /dev/null +++ b/.github/workflow/docker-build.yml @@ -0,0 +1,43 @@ +name: Docker Build and Publish + +on: + push: + branches: [ "main" ] + paths-ignore: + - '**/README.md' +env: + IMAGE_NAME: ryuupendragon/caddy-crowdsec + VERSION: 2.10.0 + +jobs: + docker-build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ secrets.GH_USERNAME }} + password: ${{ secrets.GH_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 + push: true + tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }} , ${{ env.IMAGE_NAME }}:latest