@@ -16,11 +16,6 @@ concurrency:
1616 group : ${{ github.workflow }}-${{ github.ref }}
1717 cancel-in-progress : true
1818
19- env :
20- GHCR_REGISTRY : ghcr.io
21- DOCKERHUB_REGISTRY : docker.io
22- IMAGE_NAME : ${{ github.repository }}
23-
2419jobs :
2520 build_darwin-x64 :
2621 name : Build macOS x86_64
@@ -142,80 +137,4 @@ jobs:
142137 uses : actions/upload-artifact@v4
143138 with :
144139 name : TriliumNext Notes for Windows (Setup)
145- path : out/make/squirrel.windows/x64/*.exe
146- build_docker :
147- name : Build Docker images
148- runs-on : ubuntu-latest
149- permissions :
150- contents : read
151- packages : write
152- attestations : write
153- id-token : write
154- steps :
155- - uses : actions/checkout@v4
156- - name : Extract metadata (tags, labels) for GHCR image
157- id : ghcr-meta
158- uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
159- with :
160- images : ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
161- tags :
162- - name : Extract metadata (tags, labels) for DockerHub image
163- id : dh-meta
164- uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
165- with :
166- images : ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}
167- - name : Set up node & dependencies
168- uses : actions/setup-node@v4
169- with :
170- node-version : 20
171- cache : " npm"
172- - run : npm ci
173- - name : Run the TypeScript build
174- run : npx tsc
175- - name : Create server-package.json
176- run : cat package.json | grep -v electron > server-package.json
177- - name : Log in to the GHCR container registry
178- uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
179- with :
180- registry : ${{ env.GHCR_REGISTRY }}
181- username : ${{ github.actor }}
182- password : ${{ secrets.GITHUB_TOKEN }}
183- - uses : docker/setup-buildx-action@v3
184- - name : Build and push container image to GHCR
185- uses : docker/build-push-action@v6
186- id : ghcr-push
187- with :
188- context : .
189- push : true
190- tags : ${{ steps.ghcr-meta.outputs.tags }}
191- labels : ${{ steps.ghcr-meta.outputs.labels }}
192- cache-from : type=gha
193- cache-to : type=gha,mode=max
194- - name : Generate and push artifact attestation to GHCR
195- uses : actions/attest-build-provenance@v1
196- with :
197- subject-name : ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME}}
198- subject-digest : ${{ steps.ghcr-push.outputs.digest }}
199- push-to-registry : true
200- - name : Log in to the DockerHub container registry
201- uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
202- with :
203- registry : ${{ env.DOCKERHUB_REGISTRY }}
204- username : ${{ secrets.DOCKERHUB_USERNAME }}
205- password : ${{ secrets.DOCKERHUB_TOKEN }}
206- - name : Build and push image to DockerHub
207- uses : docker/build-push-action@v6
208- id : dh-push
209- with :
210- context : .
211- push : true
212- tags : ${{ steps.dh-meta.outputs.tags }}
213- labels : ${{ steps.dh-meta.outputs.labels }}
214- cache-from : type=gha
215- cache-to : type=gha,mode=max
216- - name : Generate and push artifact attestation to DockerHub
217- uses : actions/attest-build-provenance@v1
218- with :
219- subject-name : ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME}}
220- subject-digest : ${{ steps.dh-push.outputs.digest }}
221- push-to-registry : true
140+ path : out/make/squirrel.windows/x64/*.exe
0 commit comments