parent
7aafd496ab
commit
9f62bee481
@ -1,45 +0,0 @@
|
|||||||
name: Build docker image beta
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'beta-*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
registry-url: ${{ vars.REGISTRY_URL }}
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ${{ vars.DOCKERHUB_URL }}
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
- name: Extract and format tag name
|
|
||||||
id: extract_tag
|
|
||||||
run: echo version=`echo "${{ gitea.ref }}" | cut -d'/' -f3` >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: docker/tachybase/Dockerfile
|
|
||||||
push: true
|
|
||||||
# not work now https://github.com/go-gitea/gitea/pull/29584 wait for gitea 1.23.0
|
|
||||||
# cache-from: type=gha
|
|
||||||
# cache-to: type=gha,mode=max
|
|
||||||
build-args: |
|
|
||||||
TACHYBASE_VERSION=${{ steps.extract_tag.outputs.version }}
|
|
||||||
NPM_REGISTRY=${{ vars.REGISTRY_URL }}
|
|
||||||
tags: |
|
|
||||||
${{ vars.DOCKERHUB_URL }}/tachybase/tachybase:${{ steps.extract_tag.outputs.version }}
|
|
||||||
${{ vars.DOCKERHUB_URL }}/tachybase/tachybase:beta-latest
|
|
@ -1,39 +1,22 @@
|
|||||||
name: Build docker image
|
name: build release image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'release-*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish_npm_packages:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
registry-url: ${{ vars.REGISTRY_URL }}
|
registry-url: ${{ vars.REGISTRY_URL }}
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- name: Install deps
|
|
||||||
run: pnpm install
|
|
||||||
- name: Build
|
|
||||||
run: pnpm build:p
|
|
||||||
- name: Publish
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPMTOKEN }}
|
|
||||||
run: pnpm -r publish --access=public --no-git-checks --publish-branch ${{ gitea.ref }}
|
|
||||||
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: publish_npm_packages
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
@ -44,12 +27,16 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
- name: Extract and format tag name
|
- name: Extract and format tag name
|
||||||
id: extract_tag
|
id: extract_tag
|
||||||
run: echo version=`echo "${{ gitea.ref }}" | cut -d'/' -f3 | sed 's/^v//'` >> "$GITHUB_OUTPUT"
|
run: echo version=`echo "${{ gitea.ref }}" | cut -d'/' -f3` >> "$GITHUB_OUTPUT"
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
file: docker/tachybase/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
|
# not work now https://github.com/go-gitea/gitea/pull/29584 wait for gitea 1.23.0
|
||||||
|
# cache-from: type=gha
|
||||||
|
# cache-to: type=gha,mode=max
|
||||||
build-args: |
|
build-args: |
|
||||||
TACHYBASE_VERSION=${{ steps.extract_tag.outputs.version }}
|
TACHYBASE_VERSION=${{ steps.extract_tag.outputs.version }}
|
||||||
NPM_REGISTRY=${{ vars.REGISTRY_URL }}
|
NPM_REGISTRY=${{ vars.REGISTRY_URL }}
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ ! -d "/app/nocobase" ]; then
|
|
||||||
mkdir nocobase
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "/app/nocobase/package.json" ]; then
|
|
||||||
echo 'copying...'
|
|
||||||
tar -zxf /app/nocobase.tar.gz --absolute-names -C /app/nocobase
|
|
||||||
touch /app/nocobase/node_modules/@nocobase/app/dist/client/index.html
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd /app/nocobase && pnpm tachybase create-nginx-conf
|
|
||||||
rm -rf /etc/nginx/sites-enabled/nocobase.conf
|
|
||||||
ln -s /app/nocobase/storage/nocobase.conf /etc/nginx/sites-enabled/nocobase.conf
|
|
||||||
|
|
||||||
nginx
|
|
||||||
echo 'nginx started';
|
|
||||||
|
|
||||||
if [ -z "$PM2_INSTANCE_NUM" ]; then
|
|
||||||
PM2_INSTANCE_NUM=1
|
|
||||||
fi
|
|
||||||
cd /app/nocobase && pnpm start --quickstart -i $PM2_INSTANCE_NUM
|
|
||||||
|
|
||||||
# Run command with node if the first argument contains a "-" or is not a system command. The last
|
|
||||||
# part inside the "{}" is a workaround for the following bug in ash/dash:
|
|
||||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
|
|
||||||
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
|
|
||||||
set -- node "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@ -1,89 +0,0 @@
|
|||||||
log_format apm '"$time_local" client=$remote_addr '
|
|
||||||
'method=$request_method request="$request" '
|
|
||||||
'request_length=$request_length '
|
|
||||||
'status=$status bytes_sent=$bytes_sent '
|
|
||||||
'body_bytes_sent=$body_bytes_sent '
|
|
||||||
'referer=$http_referer '
|
|
||||||
'user_agent="$http_user_agent" '
|
|
||||||
'upstream_addr=$upstream_addr '
|
|
||||||
'upstream_status=$upstream_status '
|
|
||||||
'request_time=$request_time '
|
|
||||||
'upstream_response_time=$upstream_response_time '
|
|
||||||
'upstream_connect_time=$upstream_connect_time '
|
|
||||||
'upstream_header_time=$upstream_header_time';
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name _;
|
|
||||||
root /app/nocobase/node_modules/@nocobase/app/dist/client;
|
|
||||||
index index.html;
|
|
||||||
client_max_body_size 1000M;
|
|
||||||
access_log /var/log/nginx/nocobase.log apm;
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
# 不缓存 HTML 文件
|
|
||||||
location ~ \.html$ {
|
|
||||||
if_modified_since off;
|
|
||||||
expires off;
|
|
||||||
etag off;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 缓存 JavaScript 和 CSS 文件
|
|
||||||
location ~* \.(js|css)$ {
|
|
||||||
expires 365d;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
}
|
|
||||||
|
|
||||||
location /storage/uploads/ {
|
|
||||||
alias /app/nocobase/storage/uploads/;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
access_log off;
|
|
||||||
autoindex off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /app/nocobase/node_modules/@nocobase/app/dist/client;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
add_header Last-Modified $date_gmt;
|
|
||||||
add_header Cache-Control 'no-store, no-cache';
|
|
||||||
if_modified_since off;
|
|
||||||
expires off;
|
|
||||||
etag off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ^~ /api/ {
|
|
||||||
proxy_pass http://127.0.0.1:13000/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection 'upgrade';
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_cache_bypass $http_upgrade;
|
|
||||||
proxy_connect_timeout 600;
|
|
||||||
proxy_send_timeout 600;
|
|
||||||
proxy_read_timeout 600;
|
|
||||||
send_timeout 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ^~ /static/plugins/ {
|
|
||||||
proxy_pass http://127.0.0.1:13000/static/plugins/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection 'upgrade';
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_cache_bypass $http_upgrade;
|
|
||||||
proxy_connect_timeout 600;
|
|
||||||
proxy_send_timeout 600;
|
|
||||||
proxy_read_timeout 600;
|
|
||||||
send_timeout 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /ws {
|
|
||||||
proxy_pass http://127.0.0.1:13000/ws;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
}
|
|
||||||
}
|
|
@ -86,7 +86,7 @@ export class PluginCoreClient extends Plugin {
|
|||||||
await this.app.pm.add(PluginPDF);
|
await this.app.pm.add(PluginPDF);
|
||||||
await this.app.pm.add(PluginExtendedFilterForm);
|
await this.app.pm.add(PluginExtendedFilterForm);
|
||||||
await this.app.pm.add(PluginOutbound);
|
await this.app.pm.add(PluginOutbound);
|
||||||
await this.app.pm.add(PluginModeHighlight);
|
// await this.app.pm.add(PluginModeHighlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
async registerSettings() {
|
async registerSettings() {
|
||||||
|
Loading…
Reference in New Issue
Block a user