diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml new file mode 100644 index 0000000..e1c26e5 --- /dev/null +++ b/.github/workflows/on-pull-request.yml @@ -0,0 +1,48 @@ +name: On push + +on: + pull_request: + branches: + - 'main' + paths-ignore: + - 'dashboard/*' + - 'examples/*' + - 'README.md' + - 'LICENSE' + workflow_dispatch: + +env: + PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" + +jobs: + build_container_image: + name: Build and push Docker image + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.8.0 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}-development + tags: | + type=raw,value=dev-{{date 'X'}} + type=raw,value=latest + type=ref,event=branch + type=edge,branch=main + - name: Build + uses: docker/build-push-action@v6.11.0 + with: + platforms: ${{ env.PLATFORMS }} + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + provenance: false + + diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index d7840f1..d34857c 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -18,6 +18,7 @@ jobs: build_and_push: name: Build and push Docker image runs-on: ubuntu-latest + if: ${{ github.actor != 'dependabot[bot]' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -25,7 +26,7 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.8.0 - - name: Login to docker hub + - name: Login to Docker Hub uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }}