mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
ci: Add Docker test step
This commit is contained in:
parent
a8814f0e9b
commit
5295d956a2
40
.github/workflows/main-docker.yml
vendored
40
.github/workflows/main-docker.yml
vendored
@ -15,11 +15,51 @@ env:
|
|||||||
GHCR_REGISTRY: ghcr.io
|
GHCR_REGISTRY: ghcr.io
|
||||||
DOCKERHUB_REGISTRY: docker.io
|
DOCKERHUB_REGISTRY: docker.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
TEST_TAG: triliumnext/notes:test
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
test_docker:
|
||||||
|
name: Check Docker build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Set up node & dependencies
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
|
||||||
|
- name: Run the TypeScript build
|
||||||
|
run: npx tsc
|
||||||
|
|
||||||
|
- name: Create server-package.json
|
||||||
|
run: cat package.json | grep -v electron > server-package.json
|
||||||
|
|
||||||
|
- name: Build and export to Docker
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
load: true
|
||||||
|
tags: ${{ env.TEST_TAG }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Run the container
|
||||||
|
run: |
|
||||||
|
docker run --rm ${{ env.TEST_TAG }}
|
||||||
|
|
||||||
build_docker:
|
build_docker:
|
||||||
name: Build Docker images
|
name: Build Docker images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- test_docker
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@ -8,6 +8,7 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
- "bin/**"
|
- "bin/**"
|
||||||
|
- ".github/workflows/main-docker.yml"
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user