Add OMS WMS ERP platform
Validators (Pushes and Pull Requests) / UI & Storage Validation (pull_request) Failing after 12s
Validators (Pushes and Pull Requests) / Database & Schema Validation (pull_request) Successful in 13s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (pull_request) Failing after 28s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / CI Workflow Lint (pull_request) Failing after 10s
Validators (Pushes and Pull Requests) / Security & Secrets (pull_request) Successful in 12s
Validators (Pushes and Pull Requests) / Notify PR Results (pull_request) Successful in 2s
Frontend CI Pipeline / ci-frontend-8-steps (pull_request) Failing after 2m50s

This commit is contained in:
2026-07-27 00:45:39 +09:00
parent 15dc3685df
commit b34b0dd7d6
163 changed files with 32596 additions and 0 deletions
@@ -0,0 +1,174 @@
name: Deploy to Production
on:
workflow_dispatch:
inputs:
release:
description: 'Release tag to deploy (leave empty for latest)'
required: false
default: ''
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get release version
id: get-release
run: |
if [ -z "${{ github.event.inputs.release }}" ]; then
RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases?limit=1" | jq -r '.[0].tag_name')
else
RELEASE="${{ github.event.inputs.release }}"
fi
echo "RELEASE=$RELEASE" >> $GITHUB_OUTPUT
echo "Release: $RELEASE"
- name: Download release artifact
run: |
mkdir -p artifacts
RELEASE="${{ steps.get-release.outputs.RELEASE }}"
# Get release info
RELEASE_INFO=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/$RELEASE")
ARTIFACT_ID=$(echo "$RELEASE_INFO" | jq -r '.assets[0].id')
# Download artifact
curl -L -o artifacts/oms-wms-erp.tar.gz \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/assets/$ARTIFACT_ID"
ls -lh artifacts/
- name: Verify artifact
run: |
cd artifacts
# Download and verify checksum if available
CHECKSUM_FILE=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/${{ steps.get-release.outputs.RELEASE }}" | jq -r '.assets[] | select(.name == "RELEASE_CHECKSUM.txt") | .url')
if [ ! -z "$CHECKSUM_FILE" ]; then
curl -L -o CHECKSUM.txt "$CHECKSUM_FILE"
sha256sum -c CHECKSUM.txt || exit 1
fi
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" | base64 -d > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
- name: Deploy to server
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
RELEASE: ${{ steps.get-release.outputs.RELEASE }}
run: |
ssh -i ~/.ssh/deploy_key ${DEPLOY_USER}@${DEPLOY_HOST} << 'DEPLOY_SCRIPT'
# Create deployment directory
DEPLOY_DIR="/home/kjh2064/deployments/oms-wms-erp_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$DEPLOY_DIR"
# Upload artifact
cd "$DEPLOY_DIR"
# Extract artifact from temp location
tar -xzf ~/artifacts-${{ github.run_id }}/oms-wms-erp.tar.gz
# Install dependencies
npm install --legacy-peer-deps --production
# Copy environment file
cp .env.example .env.production
# Set permissions
chmod -R 755 dist/
chmod -R 755 node_modules/
# Update active symlink
cd /home/kjh2064
rm -f oms-wms-erp_active
ln -s "$DEPLOY_DIR" oms-wms-erp_active
# Restart service
sudo systemctl restart oms-wms-erp.service
echo "✅ Deployment complete"
echo "Active version: $(readlink oms-wms-erp_active)"
DEPLOY_SCRIPT
- name: Health check
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
run: |
ssh -i ~/.ssh/deploy_key ${DEPLOY_USER}@${DEPLOY_HOST} << 'HEALTH_CHECK'
echo "Waiting for service to be ready..."
sleep 5
# Check service status
if sudo systemctl is-active --quiet oms-wms-erp.service; then
echo "✅ Service is active"
else
echo "❌ Service is not active"
sudo journalctl -u oms-wms-erp.service -n 20
exit 1
fi
# Check HTTP response
if curl -s http://127.0.0.1:5173/ > /dev/null; then
echo "✅ HTTP 200 response"
else
echo "❌ HTTP request failed"
exit 1
fi
# Check logs for errors
if sudo journalctl -u oms-wms-erp.service -n 50 | grep -i "error"; then
echo "⚠️ Errors found in logs"
else
echo "✅ No errors in logs"
fi
echo "✅ Health check passed"
HEALTH_CHECK
- name: Deployment notification
if: success()
run: |
echo "🚀 Deployment Successful"
echo "Release: ${{ steps.get-release.outputs.RELEASE }}"
echo "Status: Production deployment complete"
- name: Rollback on failure
if: failure()
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
run: |
ssh -i ~/.ssh/deploy_key ${DEPLOY_USER}@${DEPLOY_HOST} << 'ROLLBACK'
echo "🔄 Rolling back to previous version..."
cd /home/kjh2064
PREVIOUS=$(ls -t oms-wms-erp_* | grep -v active | head -1)
if [ ! -z "$PREVIOUS" ]; then
rm -f oms-wms-erp_active
ln -s "$PREVIOUS" oms-wms-erp_active
sudo systemctl restart oms-wms-erp.service
echo "✅ Rollback complete. Active version: $PREVIOUS"
fi
ROLLBACK
@@ -0,0 +1,88 @@
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.0.0)'
required: true
default: 'v1.0.0'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm install --legacy-peer-deps
- name: Build production bundle
run: npm run build
- name: Generate checksums
run: |
cd dist
find . -type f -exec sha256sum {} \; > ../CHECKSUMS.txt
cd ..
- name: Create release artifact
run: |
tar -czf oms-wms-erp-${{ github.event.inputs.version }}.tar.gz dist/ package.json package-lock.json .env.example CHECKSUMS.txt
sha256sum oms-wms-erp-${{ github.event.inputs.version }}.tar.gz > RELEASE_CHECKSUM.txt
- name: Create git tag
run: |
git config --local user.email "ci@example.com"
git config --local user.name "Gitea CI"
git tag -a ${{ github.event.inputs.version }} -m "Release ${{ github.event.inputs.version }}"
git push origin ${{ github.event.inputs.version }}
- name: Create Gitea Release
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ github.event.inputs.version }}",
"target_commitish": "main",
"name": "Release ${{ github.event.inputs.version }}",
"body": "OMS·WMS·ERP Production Release",
"draft": false,
"prerelease": false
}' \
${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases
- name: Upload artifact to release
run: |
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/${{ github.event.inputs.version }}" | jq '.id')
curl -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-F "attachment=@oms-wms-erp-${{ github.event.inputs.version }}.tar.gz" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets"
- name: Upload checksum
run: |
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/${{ github.event.inputs.version }}" | jq '.id')
curl -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-F "attachment=@RELEASE_CHECKSUM.txt" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets"
- name: Notify release ready
run: |
echo "✅ Release ${{ github.event.inputs.version }} prepared successfully"
echo "Artifact: oms-wms-erp-${{ github.event.inputs.version }}.tar.gz"
echo "Ready for deployment via deploy-prod.yml workflow"