aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/docker-pr.yml
blob: 846136624ded5015b072aa1d0bac4a8aadb693b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Docker image builds (pull requests)

on:
  pull_request:
    branches: [ "main" ]

env:
  DOCKER_METADATA_SET_OUTPUT_ENV: "true"

permissions:
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-tags: true
          fetch-depth: 0

      - uses: actions/setup-go@v5
        with:
          go-version: '1.24.x'

      - uses: ko-build/setup-ko@v0.8

      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ghcr.io/techarohq/anubis

      - name: Build and push
        id: build
        run: |
          go run ./cmd/containerbuild --docker-repo ghcr.io/techarohq/anubis --slog-level debug
        env:
          PULL_REQUEST_ID: ${{ github.event.number }}

      - run: |
          echo "Test this with:"
          echo "docker pull ${{ steps.build.outputs.docker_image }}"