Weighs the soul of incoming HTTP requests to stop AI crawlers
1name: Docker image builds (pull requests)
2
3on:
4 pull_request:
5 branches: [ "main" ]
6
7env:
8 DOCKER_METADATA_SET_OUTPUT_ENV: "true"
9
10permissions:
11 contents: read
12
13jobs:
14 build:
15 runs-on: ubuntu-24.04
16 steps:
17 - name: Checkout code
18 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19 with:
20 fetch-tags: true
21 fetch-depth: 0
22 persist-credentials: false
23
24 - name: Set up Homebrew
25 uses: Homebrew/actions/setup-homebrew@main
26
27 - name: Setup Homebrew cellar cache
28 uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
29 with:
30 path: |
31 /home/linuxbrew/.linuxbrew/Cellar
32 /home/linuxbrew/.linuxbrew/bin
33 /home/linuxbrew/.linuxbrew/etc
34 /home/linuxbrew/.linuxbrew/include
35 /home/linuxbrew/.linuxbrew/lib
36 /home/linuxbrew/.linuxbrew/opt
37 /home/linuxbrew/.linuxbrew/sbin
38 /home/linuxbrew/.linuxbrew/share
39 /home/linuxbrew/.linuxbrew/var
40 key: ${{ runner.os }}-go-homebrew-cellar-${{ hashFiles('go.sum') }}
41 restore-keys: |
42 ${{ runner.os }}-go-homebrew-cellar-
43
44 - name: Install Brew dependencies
45 run: |
46 brew bundle
47
48 - name: Docker meta
49 id: meta
50 uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
51 with:
52 images: ghcr.io/${{ github.repository }}
53
54 - name: Build and push
55 id: build
56 run: |
57 npm ci
58 npm run container
59 env:
60 PULL_REQUEST_ID: ${{ github.event.number }}
61 DOCKER_REPO: ghcr.io/${{ github.repository }}
62 SLOG_LEVEL: debug
63
64 - run: |
65 echo "Test this with:"
66 echo "docker pull ${DOCKER_IMAGE}"
67 env:
68 DOCKER_IMAGE: ${{ steps.build.outputs.docker_image }}