auto build
This commit is contained in:
parent
a7de868d83
commit
56a365c6b4
59
.gitea/workflows/build.yaml
Normal file
59
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
name: Build and Deploy Next.js + Nginx Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# branches:
|
||||||
|
# - main
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ secrets.REGISTRY_URL }}
|
||||||
|
TAG: v${{ gitea.run_number }}
|
||||||
|
REPO: ${{ gitea.repository }}
|
||||||
|
IMAGE: ${{ secrets.REGISTRY_URL }}/${{ gitea.repository }}:v${{ gitea.run_number }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout source
|
||||||
|
uses: https://git.d.aiengines.ir/actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: https://git.d.aiengines.ir/actions/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Docker registry
|
||||||
|
uses: https://git.d.aiengines.ir/actions/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REGISTRY_URL }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: https://git.d.aiengines.ir/actions/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||||
|
${{ env.REGISTRY }}/${{ env.REPO }}:${{ env.TAG }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-and-deploy
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: deploy on server
|
||||||
|
uses: appleboy/ssh-action@v1
|
||||||
|
env:
|
||||||
|
DRONE_SSH_RELEASE_URL: https://cdn.d.aiengines.ir/public/drone-ssh/releases
|
||||||
|
DRONE_SSH_VERSION: 1.8.1
|
||||||
|
with:
|
||||||
|
host: 192.168.130.25
|
||||||
|
username: bagher
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
docker service update -d --image ${{ env.IMAGE }} --force --with-registry-auth ${{ github.event.repository.name }}
|
||||||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM docker.ibagher.ir/python:3.11-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./dist ./dist
|
||||||
|
|
||||||
|
CMD ["python3", "-m", "http.server", "--bind", "0.0.0.0", "8000", "--directory", "./dist/remote"]
|
||||||
8
dist/remote-ui.d.ts
vendored
Normal file
8
dist/remote-ui.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import type { ComponentType, ReactNode } from "react";
|
||||||
|
|
||||||
|
export type GBadgeProps = {
|
||||||
|
children?: ReactNode;
|
||||||
|
[key: string]: unknown;
|
||||||
|
};
|
||||||
|
|
||||||
|
export declare const GBadge: ComponentType<GBadgeProps>;
|
||||||
43
dist/remote-ui.js
vendored
Normal file
43
dist/remote-ui.js
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { jsx as c } from "react/jsx-runtime";
|
||||||
|
import { useRef as s, useEffect as i } from "react";
|
||||||
|
const a = "https://uikit.d.aiengines.ir/remote/GBadge.js";
|
||||||
|
let n = null;
|
||||||
|
function u() {
|
||||||
|
return n || (n = import(
|
||||||
|
/* webpackIgnore: true */
|
||||||
|
/* @vite-ignore */
|
||||||
|
a
|
||||||
|
)), n;
|
||||||
|
}
|
||||||
|
const m = (o) => {
|
||||||
|
const r = s(null);
|
||||||
|
return i(() => {
|
||||||
|
let e = !0;
|
||||||
|
return u().then((t) => {
|
||||||
|
e && r.current && t.mount(r.current, o);
|
||||||
|
}).catch((t) => {
|
||||||
|
console.error("[uikit/remote/ui] Failed to load GBadge:", t);
|
||||||
|
}), () => {
|
||||||
|
e = !1;
|
||||||
|
};
|
||||||
|
}, [o]), i(() => {
|
||||||
|
const e = r.current;
|
||||||
|
return () => {
|
||||||
|
e && u().then((t) => {
|
||||||
|
t.unmount(e);
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}, []), /* @__PURE__ */ c(
|
||||||
|
"span",
|
||||||
|
{
|
||||||
|
ref: r,
|
||||||
|
style: {
|
||||||
|
display: "contents"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export {
|
||||||
|
m as GBadge
|
||||||
|
};
|
||||||
@ -33,7 +33,8 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vite build && yarn copy-types",
|
"build": "yarn build:lib && yarn build:remote && yarn copy-types",
|
||||||
|
"build:lib": "vite build",
|
||||||
"build:remote": "vite build --mode remote",
|
"build:remote": "vite build --mode remote",
|
||||||
"copy-types": "yarn copy-index-types && yarn copy-utils-types && yarn copy-core-types && yarn copy-remote-ui-types",
|
"copy-types": "yarn copy-index-types && yarn copy-utils-types && yarn copy-core-types && yarn copy-remote-ui-types",
|
||||||
"copy-index-types": "cp src/index.d.ts dist/index.d.ts",
|
"copy-index-types": "cp src/index.d.ts dist/index.d.ts",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user