Merge branch 'main' into development
# Conflicts: # .github/workflows/release.yaml
This commit is contained in:
commit
e9287e8dd7
2 changed files with 43 additions and 10 deletions
44
.github/workflows/release.yaml
vendored
44
.github/workflows/release.yaml
vendored
|
|
@ -1,17 +1,10 @@
|
|||
name: release
|
||||
|
||||
run-name: release ${{ github.actor }}
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
IMAGE_VER:
|
||||
description: image version
|
||||
type: string
|
||||
|
||||
env:
|
||||
REGISTRY: docker.frappet.com
|
||||
IMAGE_NAME: edm/core
|
||||
|
|
@ -79,3 +72,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- name: Notify Discord Success
|
||||
if: success()
|
||||
run: |
|
||||
curl -H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"embeds": [{
|
||||
"title": "✅ Deployment Success!",
|
||||
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
|
||||
"color": 3066993,
|
||||
"footer": {
|
||||
"text": "Release Notification",
|
||||
"icon_url": "https://example.com/success-icon.png"
|
||||
},
|
||||
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||
}]
|
||||
}' \
|
||||
${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
- name: Notify Discord Failure
|
||||
if: failure()
|
||||
run: |
|
||||
curl -H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"embeds": [{
|
||||
"title": "❌ Deployment Failed!",
|
||||
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
|
||||
"color": 15158332,
|
||||
"footer": {
|
||||
"text": "Release Notification",
|
||||
"icon_url": "https://example.com/failure-icon.png"
|
||||
},
|
||||
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||
}]
|
||||
}' \
|
||||
${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ export async function handler(key: string, event: string): Promise<boolean> {
|
|||
try {
|
||||
const stat = await minioClient.statObject(bucket, pathname);
|
||||
cachedMetadata[key] = { size: stat.size, type: stat.metaData["content-type"] };
|
||||
if (stat.size > 1024 * 1024 * 100) cachedBuffer[key] = Buffer.from([]);
|
||||
if (stat.size > 1024 * 1024 * 100) {
|
||||
console.warn("[AMQ] File is too large. Data extract will be skipped.");
|
||||
cachedBuffer[key] = Buffer.from([]);
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (e.code === "NoSuchKey") {
|
||||
console.info(`[AMQ] Key: ${key} received but cannot be found.`);
|
||||
|
|
@ -151,7 +154,7 @@ async function handleNotFoundRecord(
|
|||
|
||||
if (!errorKey.includes(key)) {
|
||||
try {
|
||||
Buffer.from(buffer).toString("base64");
|
||||
base64 = Buffer.from(buffer).toString("base64");
|
||||
} catch (e) {
|
||||
console.warn("[WARN] Cannot extract data from the file.", e);
|
||||
}
|
||||
|
|
@ -214,7 +217,7 @@ async function handleFoundRecord(
|
|||
|
||||
if (!errorKey.includes(key)) {
|
||||
try {
|
||||
Buffer.from(buffer).toString("base64");
|
||||
base64 = Buffer.from(buffer).toString("base64");
|
||||
} catch (e) {
|
||||
console.warn("[WARN] Cannot extract data from the file.", e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue