From ea5708817734e7088e16de2156a8c344d5382ab8 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Fri, 4 Nov 2022 16:34:30 +0100 Subject: [PATCH] tools: github actions: build docker images on pull requests - fixes https://github.com/shaarli/Shaarli/issues/1800 - do not push, only check that the image builds correctly - tag the image as :pr-PR_NUMBER --- .github/workflows/docker-pr.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/docker-pr.yml diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml new file mode 100644 index 000000000..16adede9d --- /dev/null +++ b/.github/workflows/docker-pr.yml @@ -0,0 +1,21 @@ +name: Build Docker image (Pull Request) +on: + pull_request: + branches: [ master ] + +jobs: + docker-build: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + push: false + tags: shaarli/shaarli:pr-${{ github.event.number }} + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}