aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/docker-pr.yml
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-03-22 11:26:49 -0400
committerGitHub <noreply@github.com>2025-03-22 11:26:49 -0400
commit56cdb2e51b6435ed21b81eebb763e19e7aec3ce6 (patch)
treeae816399f3f0469bc6e7d2250e1488588b2727fc /.github/workflows/docker-pr.yml
parent15d801be7de4cd9eea91bcec177b30d1bc15310b (diff)
downloadanubis-56cdb2e51b6435ed21b81eebb763e19e7aec3ce6.tar.xz
anubis-56cdb2e51b6435ed21b81eebb763e19e7aec3ce6.zip
Fix docker image CI for pull requests (#84)
Closes #65 Pull request images will now be `ttl.sh/techaro/pr-{number}/anubis:24h`.
Diffstat (limited to '.github/workflows/docker-pr.yml')
-rw-r--r--.github/workflows/docker-pr.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml
new file mode 100644
index 0000000..8461366
--- /dev/null
+++ b/.github/workflows/docker-pr.yml
@@ -0,0 +1,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 }}" \ No newline at end of file