Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(build): try using ARM runner for building docker
Elian Doranca1d5207d874
diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.ymlindex e3f2393b95..0c1be531ab 100644--- a/.github/workflows/main-docker.yml+++ b/.github/workflows/main-docker.yml@@ -33,7 +33,7 @@ jobs:steps:- name: Checkout the repositoryuses: actions/checkout@v4-+- name: Set IMAGE_NAME to lowercaserun: echo "IMAGE_NAME=${IMAGE_NAME,,}" >> $GITHUB_ENV- name: Set TEST_TAG to lowercase@@ -47,16 +47,16 @@ jobs:with:node-version: 20cache: "npm"-+- name: Install npm dependenciesrun: npm ci- name: Install Playwright Browsersrun: npx playwright install --with-deps-+- name: Run the TypeScript buildrun: npx tsc-+- name: Create server-package.jsonrun: cat package.json | grep -v electron > server-package.json@@ -69,12 +69,12 @@ jobs:tags: ${{ env.TEST_TAG }}cache-from: type=ghacache-to: type=gha,mode=max-+- name: Validate container run outputrun: |CONTAINER_ID=$(docker run -d --log-driver=journald --rm --network=host -e TRILIUM_PORT=8082 --volume ./integration-tests/db:/home/node/trilium-data --name trilium_local ${{ env.TEST_TAG }})echo "Container ID: $CONTAINER_ID"-+- name: Wait for the healthchecks to passuses: stringbean/docker-healthcheck-action@v3with:@@ -82,7 +82,7 @@ jobs:wait-time: 50require-status: runningrequire-healthy: true-+- name: Run Playwright testsrun: TRILIUM_DOCKER=1 npx playwright test- uses: actions/upload-artifact@v4@@ -100,24 +100,27 @@ jobs:build:name: Build Docker images- runs-on: ubuntu-latest- needs:- - test_docker- permissions:- contents: read- packages: write- attestations: write- id-token: writestrategy:fail-fast: falsematrix:include:- dockerfile: Dockerfile.alpineplatform: linux/amd64+ image: ubuntu-latest- dockerfile: Dockerfileplatform: linux/arm64+ image: ubuntu-24.04-arm- dockerfile: Dockerfileplatform: linux/arm/v7+ image: ubuntu-24.04-arm+ runs-on: ${{ matrix.image }}+ needs:+ - test_docker+ permissions:+ contents: read+ packages: write+ attestations: write+ id-token: writesteps:- name: Preparerun: |@@ -144,13 +147,13 @@ jobs:type=shaflavor: |latest=false-+- name: Set up QEMUuses: docker/setup-qemu-action@v3-+- name: Set up Docker Buildxuses: docker/setup-buildx-action@v3-+- name: Set up node & dependenciesuses: actions/setup-node@v4@@ -169,14 +172,14 @@ jobs:registry: ${{ env.GHCR_REGISTRY }}username: ${{ github.actor }}password: ${{ secrets.GITHUB_TOKEN }}-+- name: Login to DockerHubuses: docker/login-action@v3with:registry: ${{ env.DOCKERHUB_REGISTRY }}username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}-+- name: Build and push by digestid: builduses: docker/build-push-action@v6@@ -186,13 +189,13 @@ jobs:platforms: ${{ matrix.platform }}labels: ${{ steps.meta.outputs.labels }}outputs: type=image,name=${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true-+- name: Export digestrun: |mkdir -p /tmp/digestsdigest="${{ steps.build.outputs.digest }}"touch "/tmp/digests/${digest#sha256:}"-+- name: Upload digestuses: actions/upload-artifact@v4with:@@ -220,7 +223,7 @@ jobs:- name: Set up Docker Buildxuses: docker/setup-buildx-action@v3-+- name: Docker metaid: metauses: docker/metadata-action@v5@@ -237,14 +240,14 @@ jobs:registry: ${{ env.GHCR_REGISTRY }}username: ${{ github.actor }}password: ${{ secrets.GITHUB_TOKEN }}-+- name: Login to DockerHubuses: docker/login-action@v3with:registry: ${{ env.DOCKERHUB_REGISTRY }}username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}-+- name: Create manifest list and pushworking-directory: /tmp/digestsrun: |@@ -255,7 +258,7 @@ jobs:docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${REF_NAME} \$(printf '${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)-+docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${REF_NAME} \$(printf '${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)@@ -267,25 +270,25 @@ jobs:docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:stable \$(printf '${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)-+docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:stable \$(printf '${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)-+# Small delay to ensure stable tag is fully propagatedsleep 5-+# Now update latest tagsdocker buildx imagetools create \-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:latest \${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:stable-+docker buildx imagetools create \-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:latest \${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:stable-+fi-+- name: Inspect imagerun: |docker buildx imagetools inspect ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}