-
-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: docker镜像tag存档 | ||
on: | ||
workflow_dispatch: #github页面手动触发 | ||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Initialization environment | ||
run : | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
sudo timedatectl set-timezone "Asia/Shanghai" | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
with: | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ref: main | ||
|
||
- name: Check and download remote files | ||
run: | | ||
wget https://github.com/Nriver/trilium-translation/releases/download/v0.62.4_20231222/trilium-cn-linux-x64-server.zip | ||
# wget https://github.com/Nriver/trilium-translation/releases/latest/download/trilium-cn-linux-x64-server.zip | ||
unzip -q trilium-cn-linux-x64-server.zip | ||
rm -f trilium-cn-linux-x64-server.zip | ||
sed -i '/electron/d' ./trilium-linux-x64-server/package.json | ||
- name: Show files | ||
run: | | ||
pwd | ||
ls | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ./Dockerfile_github_action | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/trilium-cn:0.62.4 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 发布docker镜像 | ||
on: | ||
workflow_dispatch: #github页面手动触发 | ||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Initialization environment | ||
run : | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
sudo timedatectl set-timezone "Asia/Shanghai" | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
with: | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ref: main | ||
|
||
- name: Check and download remote files | ||
run: | | ||
wget https://github.com/Nriver/trilium-translation/releases/latest/download/trilium-cn-linux-x64-server.zip | ||
unzip -q trilium-cn-linux-x64-server.zip | ||
rm -f trilium-cn-linux-x64-server.zip | ||
sed -i '/electron/d' ./trilium-linux-x64-server/package.json | ||
- name: Show files | ||
run: | | ||
pwd | ||
ls | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ./Dockerfile_github_action | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/trilium-cn:latest | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Dockerfile for build up the image | ||
FROM node:18.18.2-alpine | ||
|
||
LABEL MAINTAINER https://github.com/Nriver/trilium-translation | ||
|
||
ADD trilium-linux-x64-server /app | ||
WORKDIR /app | ||
|
||
# 添加curl jq命令给health check使用 | ||
# 合并RUN减少镜像层数 | ||
# 减少镜像大小 purge清理包列表 | ||
RUN apk add --virtual .build-dependencies \ | ||
autoconf \ | ||
automake \ | ||
g++ \ | ||
gcc \ | ||
libtool \ | ||
make \ | ||
nasm \ | ||
libpng-dev \ | ||
python3 \ | ||
&& cp ./node_modules/@excalidraw/excalidraw/dist/excalidraw-assets/Virgil.woff2 ./Virgil.ttf \ | ||
&& rm -rf ./node_modules \ | ||
&& rm -rf ./node \ | ||
&& npm ci --production \ | ||
&& apk del .build-dependencies \ | ||
&& apk add curl jq \ | ||
&& npm prune --omit=dev \ | ||
&& mv -f ./Virgil.ttf ./node_modules/@excalidraw/excalidraw/dist/excalidraw-assets/Virgil.woff2 \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& rm -rf /var/log | ||
|
||
EXPOSE 8080 | ||
CMD node /app/src/www |