From 9e946c51f5375e2957ea91c955257443cf80b637 Mon Sep 17 00:00:00 2001 From: Mahros AL-Qabasy Date: Sat, 31 Jan 2026 01:13:39 +0200 Subject: [PATCH 1/3] added dev branch --- .github/workflows/build.yml | 49 ---------------------- .github/workflows/deploy.yml | 43 ------------------- .github/workflows/dev.docker.yml | 46 +++++++++++++++++++++ .github/workflows/main.docker.yml | 48 +++++++++++++++++++++ .github/workflows/release.yml | 69 +++++++++++++++++++++++-------- package.json | 4 +- 6 files changed, 148 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/dev.docker.yml create mode 100644 .github/workflows/main.docker.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 9876d10..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build Only - -on: - push: - branches: - - build - -jobs: - build: - 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' - - - name: Cache Node modules - uses: actions/cache@v3 - with: - path: ./app/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('app/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Install dependencies - run: npm ci --legacy-peer-deps - working-directory: ./app - - - name: Run lint - run: npm run lint || echo "No lint errors" - working-directory: ./app - - - name: Run tests - run: npm test || echo "No tests configured" - working-directory: ./app - - - name: Build app - run: npm run build - working-directory: ./app - - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - name: app-dist - path: ./app/dist \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index fc67c9d..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build and Deploy - -on: - push: - branches: - - main - tags: - - "v*" # triggers on any tag like v1.0.0, v1.1.0 - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: "18" - - - name: Install dependencies - run: npm ci --legacy-peer-deps - - - name: Run type check - run: npm run type-check || echo "No typescript errors" - - - name: Run lint - run: npm run lint || echo "No lint errors" - - - name: Run tests - run: npm test || echo "No tests configured" - - - name: Build - run: npm run build - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist \ No newline at end of file diff --git a/.github/workflows/dev.docker.yml b/.github/workflows/dev.docker.yml new file mode 100644 index 0000000..46b1410 --- /dev/null +++ b/.github/workflows/dev.docker.yml @@ -0,0 +1,46 @@ +name: Publish API Image (Dev) + +on: + push: + branches: + - dev + +permissions: + contents: read + packages: write + +jobs: + docker-build-push-dev: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + 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.GITHUB_TOKEN }} + + - name: Extract Docker metadata (Dev) + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/pressiqo-land + tags: | + dev + + - name: Build and push Docker image (Dev) + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.docker.yml b/.github/workflows/main.docker.yml new file mode 100644 index 0000000..0dca502 --- /dev/null +++ b/.github/workflows/main.docker.yml @@ -0,0 +1,48 @@ +name: Publish API Image + +on: + push: + branches: + - main + tags: + - "v*.*.*" + +permissions: + contents: read + packages: write + +jobs: + docker-build-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + 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.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/pressiqo-land + tags: | + latest + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cd9468..78de467 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,33 +1,68 @@ -name: Build Only +name: Release API on: push: branches: - - build + - main + +permissions: + contents: write jobs: - build: + build-and-release: runs-on: ubuntu-latest - + defaults: + run: + shell: bash steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 + cache: npm - name: Install dependencies - run: npm ci --legacy-peer-deps - working-directory: ./app + run: | + if [ -f package-lock.json ]; then + npm ci + else + npm install + fi + + - name: Build production bundle + run: npm run build --if-present - - name: Build - run: npm run build - working-directory: ./app + - name: Compute release tag + id: version + run: echo "tag=v$(date +'%Y.%m.%d')-${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT" + + - name: Prepare release archive + run: | + mkdir -p release + cp -r dist release/ + cp package.json release/ + [ -f package-lock.json ] && cp package-lock.json release/ + cp tsconfig.json release/ || true + tar -czf pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz -C release . - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + with: + name: pressiqo-land-${{ steps.version.outputs.tag }} + path: pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz + retention-days: 14 + + - name: Publish GitHub release + uses: softprops/action-gh-release@v2 with: - name: app-dist - path: ./app/dist \ No newline at end of file + tag_name: ${{ steps.version.outputs.tag }} + name: pressiqo.app ${{ steps.version.outputs.tag }} + body: | + Automated release for pressiqo.app + - Commit: ${{ github.sha }} + - Build: ${{ github.run_id }} + files: | + pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz diff --git a/package.json b/package.json index 3cba1d0..9e4f278 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "www.pressiqo.app", + "name": "www.pressqo.com", "private": true, "version": "0.0.0", "type": "module", @@ -21,4 +21,4 @@ "typescript": "~5.8.2", "vite": "^6.2.0" } -} +} \ No newline at end of file From a17799f328cba16824f7900c522597c4fedd70e4 Mon Sep 17 00:00:00 2001 From: Mahros AL-Qabasy Date: Sat, 31 Jan 2026 01:17:55 +0200 Subject: [PATCH 2/3] updated dev, dockerfile --- App.tsx | 2 +- Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ nginx.conf | 19 +++++++++++++++++++ package-lock.json | 4 ++-- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/App.tsx b/App.tsx index 7a5fdfb..0fac0f3 100644 --- a/App.tsx +++ b/App.tsx @@ -25,7 +25,7 @@ const App: React.FC = () => { - + {/* */}