aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@anshulg.com> 2024-11-15 14:18:16 -0800
committerGravatar Anshul Gupta <ansg191@anshulg.com> 2024-11-15 14:18:16 -0800
commitcd2f847c940a5cf110d138a48d66d1140b76c4f8 (patch)
tree1a9423ead127c90562f4112a1cf4b443ec7aa3a3
parent999afd4adb73540e6def7b02e110e76a515ae169 (diff)
downloadminiflux-ai-cd2f847c940a5cf110d138a48d66d1140b76c4f8.tar.gz
miniflux-ai-cd2f847c940a5cf110d138a48d66d1140b76c4f8.tar.zst
miniflux-ai-cd2f847c940a5cf110d138a48d66d1140b76c4f8.zip
Improve docker CI build
-rw-r--r--.github/workflows/docker-image.yml23
1 files changed, 19 insertions, 4 deletions
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index 1c10592..ac96a94 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -1,8 +1,12 @@
name: miniflux_ai docker image
on:
- release:
- types: [ published ]
+ push:
+ branches: [ "main" ]
+ # Publish semver tags as releases.
+ tags: [ '*.*.*' ]
+ pull_request:
+ branches: [ "main" ]
jobs:
build-and-push:
@@ -24,6 +28,7 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
+ if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
@@ -37,12 +42,22 @@ jobs:
images: |
ghcr.io/${{ github.repository }}
tags: |
- type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
+ type=schedule,pattern=nightly
+ type=ref,event=branch
+ type=ref,event=pr
+ type=semver,pattern={{version}}
+ type=semver,pattern={{major}}.{{minor}}
+ type=semver,pattern={{major}}
+ type=sha
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
+ context: .
platforms: linux/amd64,linux/arm64
- push: true
+ push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max