ci: update script
Release package / release (push) Failing after 1m50s
Release package / build-and-push (push) Failing after 2m25s
Release package / deploy-via-portainer (push) Has been skipped

This commit is contained in:
TakahashiNg
2026-03-26 14:40:14 +00:00
parent 1dec5b6341
commit 174e46a50a
7 changed files with 70 additions and 4 deletions
+5
View File
@@ -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.
+31 -1
View File
@@ -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 }}"
+1
View File
@@ -20,6 +20,7 @@
# production
/build
/release.zip
# misc
.DS_Store
+5
View File
@@ -0,0 +1,5 @@
FROM nginx:alpine
COPY out/ /usr/share/nginx/html/
EXPOSE 80
+6 -1
View File
@@ -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
View File
@@ -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",
},
],
},
+19
View File
@@ -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");