feat: add workflows, refactor Dockerfile, and enhance routers structure

This commit is contained in:
Ilay
2025-06-06 11:50:00 +05:00
parent e912813c03
commit db935c214b
23 changed files with 345 additions and 188 deletions

33
.github/workflows/build-dev.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: remnashop - Build and Push (dev)
on:
push:
branches:
- dev
jobs:
docker-build:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: 🧾 Checkout Repository
uses: actions/checkout@v4
- name: 🛠️ Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 🔐 Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: 🏗️ Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository }}:dev

63
.github/workflows/release-dev.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: remnashop - Release Artifact (dev)
on:
push:
branches:
- dev
jobs:
release:
name: Build and Publish Dev Artifact
runs-on: ubuntu-latest
steps:
- name: 🧾 Checkout Repository
uses: actions/checkout@v3
- name: 🧱 Generate Build Metadata
run: |
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8)
BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
BRANCH="${{ github.ref_name }}"
FULL_SHA="${{ github.sha }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/$SHORT_SHA"
cat <<EOF > build.info.json
{
"buildTime": "$BUILD_TIME",
"commitFull": "$FULL_SHA",
"commit": "$SHORT_SHA",
"tag": "dev-build",
"branch": "$BRANCH",
"commitUrl": "$COMMIT_URL"
}
EOF
- name: 📁 Archive Project Files
run: |
zip -r remnashop-dev.zip . -x ".git/*" ".github/*" "logs/*" "*.zip"
- name: 🧹 Remove Previous Artifact (if exists)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete-asset dev-build remnashop-dev.zip || true
- name: ⬆️ Upload Artifact to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload dev-build remnashop-dev.zip --clobber
- name: 📝 Update Release Notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
DATE=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
gh release edit dev-build --notes-file - <<EOF
🔁 Updated development build
🔗 [Commit]($COMMIT_URL)
📅 Built: $DATE
EOF