ci: update script
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
"packages": "pnpm",
|
||||
"upgradePackages": true
|
||||
}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": ["esbenp.prettier-vscode"]
|
||||
}
|
||||
}
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
|
||||
@@ -63,4 +63,34 @@ jobs:
|
||||
git add .
|
||||
git commit -m "chore: release [ci skip]"
|
||||
git push
|
||||
fi
|
||||
fi
|
||||
|
||||
build-and-push:
|
||||
# if: gitea.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.demonkernel.io.vn
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: gitea.demonkernel.io.vn/${{ gitea.repository }}:latest
|
||||
|
||||
deploy-via-portainer:
|
||||
if: gitea.ref == 'refs/heads/main'
|
||||
needs: build-and-push
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Portainer Webhook
|
||||
run: |
|
||||
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
# production
|
||||
/build
|
||||
/release.zip
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY out/ /usr/share/nginx/html/
|
||||
|
||||
EXPOSE 80
|
||||
+6
-1
@@ -9,6 +9,11 @@ import type { NextConfig } from "next";
|
||||
*
|
||||
* Docs: https://nextjs.org/docs/app/api-reference/next-config-js
|
||||
*/
|
||||
const nextConfig: NextConfig = {};
|
||||
const nextConfig: NextConfig = {
|
||||
output: "export", // Bắt buộc để tạo ra thư mục /out
|
||||
images: {
|
||||
unoptimized: true, // Thường cần thiết cho static export
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
+3
-2
@@ -16,12 +16,13 @@ const config: GlobalConfig = {
|
||||
},
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
"@saithodev/semantic-release-gitea",
|
||||
{
|
||||
giteaUrl: "https://git.demonkernel.io.vn/",
|
||||
assets: [
|
||||
{
|
||||
path: "release.zip",
|
||||
name: "TDTU Auto Login v${nextRelease.version}.zip",
|
||||
name: "Drinkool v${nextRelease.version}.zip",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { execSync } from "node:child_process";
|
||||
|
||||
const version = process.argv[2];
|
||||
if (!version) {
|
||||
console.error("❌ Version không được cung cấp!");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const zipPath = "release.zip";
|
||||
|
||||
console.log(`📦 Đang nén file cho version: ${version}...`);
|
||||
|
||||
execSync(`zip -r ${zipPath} out`, {
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
console.log(`✅ Đã tạo file zip: ${zipPath}`);
|
||||
|
||||
execSync("pnpm format");
|
||||
Reference in New Issue
Block a user