Skip to content

Build your personal knowledge base with Trilium Notes

Add tag based multi arch docker build. (#2229)

TrAnn3l8ef4b2bf50d0
diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml
new file mode 100644
index 0000000000..c2db4becf4
--- /dev/null
+++ b/.github/workflows/docker.yaml
@@ -0,0 +1,53 @@
+name: Publish Docker image
+on:
+ push:
+ tags: [v*]
+jobs:
+ push_to_registries:
+ name: Push Docker image to multiple registries
+ runs-on: ubuntu-latest
+ permissions:
+ packages: write
+ contents: read
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ - name: Docker meta
+ id: meta
+ uses: docker/metadata-action@v3
+ with:
+ images: |
+ zadam/trilium
+ ghcr.io/zadam/trilium
+ tags: |
+ type=semver,pattern={{version}}
+ type=semver,pattern={{major}}.{{minor}}-latest
+ type=match,pattern=(\d+.\d+).\d+\-beta,enable=${{ endsWith(github.ref, 'beta') }},group=1,suffix=-latest
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+ with:
+ install: true
+ - name: Log in to Docker Hub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+ - name: Log in to GitHub Docker Registry
+ uses: docker/login-action@v1
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Create server-package.json
+ run: cat package.json | grep -v electron > server-package.json
+ - name: Build and Push
+ uses: docker/[email protected]
+ with:
+ context: .
+ platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
+ push: true
+ cache-from: type=registry,ref=zadam/trilium:buildcache
+ cache-to: type=registry,ref=zadam/trilium:buildcache,mode=max
+ tags: ${{ steps.meta.outputs.tags }}