diff --git a/.github/workflows/mainnet-api-main.yml b/.github/workflows/mainnet-api-main.yml deleted file mode 100644 index 7ae92c21..00000000 --- a/.github/workflows/mainnet-api-main.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: '[Mainnet] Api Main' - -on: - push: - tags: - - 'api/v*' - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Get version from tag - id: git_tag - run: | - VERSION="${GITHUB_REF_NAME#api/-}" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Auth GCloud - uses: google-github-actions/auth@v2 - with: - workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.SERVICE_ACCOUNT }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v3 - - - name: Configure Docker - run: gcloud auth configure-docker ${{ secrets.REGION }}-docker.pkg.dev --quiet - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: ./packages/api-main/Dockerfile - push: true - tags: - ${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/dither-chat/api-main:${{ steps.get_tag.outputs.version }} - - notify: - needs: [build] - if: failure() - runs-on: ubuntu-latest - steps: - - uses: appleboy/telegram-action@v1.0.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - format: markdown - message: | - 🚨 *Deploy API Mainnet Failed* 🚨 - - 🔗 *Repository*: [${{ github.repository }}](https://github.com/${{ github.repository }}) - 📝 *Commit*: ${{ github.event.commits[0].message }} - 👤 *Author*: ${{ github.actor }} - ⛓️‍💥 *App*: ${{ inputs.app_name }} - - 🔍 [View Logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - Please investigate and fix *ASAP*! 🔧 diff --git a/.github/workflows/mainnet-reader-main.yml b/.github/workflows/mainnet-reader-main.yml deleted file mode 100644 index d68d1535..00000000 --- a/.github/workflows/mainnet-reader-main.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: '[Mainnet] Reader Main' - -on: - push: - tags: - - 'reader/v*' - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Get version from tag - id: git_tag - run: | - VERSION="${GITHUB_REF_NAME#reader/-}" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Auth GCloud - uses: google-github-actions/auth@v2 - with: - workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.SERVICE_ACCOUNT }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v3 - - - name: Configure Docker - run: gcloud auth configure-docker ${{ secrets.REGION }}-docker.pkg.dev --quiet - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: ./packages/reader-main/Dockerfile - push: true - tags: - ${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/dither-chat/reader-main:${{ steps.get_tag.outputs.version }} diff --git a/.github/workflows/mainnet-frontend.yml b/.github/workflows/netlify-frontend.yml similarity index 89% rename from .github/workflows/mainnet-frontend.yml rename to .github/workflows/netlify-frontend.yml index a1bdc49b..3b2679c6 100644 --- a/.github/workflows/mainnet-frontend.yml +++ b/.github/workflows/netlify-frontend.yml @@ -3,7 +3,7 @@ name: '[Mainnet] Frontend' on: push: tags: - - 'frontend/v*' + - 'v*' jobs: release: @@ -15,7 +15,7 @@ jobs: - name: Get version from tag id: git_tag run: | - VERSION="${GITHUB_REF_NAME#frontend/-}" + VERSION="${GITHUB_REF_NAME}" echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Publish diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml deleted file mode 100644 index e510f7c2..00000000 --- a/.github/workflows/smoke-tests.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Smoke Tests - -on: - workflow_call: - inputs: - app_name: - required: true - type: string - -jobs: - smoke-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.3.2 - - - name: Install dependencies - run: bun install - - - name: Run tests - working-directory: packages/api-main - run: bun run test:smoke - env: - APP_NAME: ${{ inputs.app_name }} - - notify: - needs: [smoke-tests] - if: failure() - runs-on: ubuntu-latest - steps: - - uses: appleboy/telegram-action@v1.0.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - format: markdown - message: | - 🚨 *Smoke Tests Failed* 🚨 - - 🔗 *Repository*: [${{ github.repository }}](https://github.com/${{ github.repository }}) - 📝 *Commit*: ${{ github.event.commits[0].message }} - 👤 *Author*: ${{ github.actor }} - ⛓️‍💥 *App*: ${{ inputs.app_name }} - - 🔍 [View Logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - Please investigate and fix *ASAP*! 🔧 diff --git a/.github/workflows/frontend-e2e.yml b/.github/workflows/test-frontend-e2e.yml similarity index 100% rename from .github/workflows/frontend-e2e.yml rename to .github/workflows/test-frontend-e2e.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3d2d910..77954522 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:15 + image: postgres:18 env: POSTGRES_USER: default POSTGRES_PASSWORD: password diff --git a/.github/workflows/testnet-api-main.yml b/.github/workflows/testnet-api-main.yml deleted file mode 100644 index 02c677d6..00000000 --- a/.github/workflows/testnet-api-main.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: '[Testnet] Api Main' - -on: - pull_request: - branches: - - main - push: - branches: - - main - workflow_dispatch: - -jobs: - detect-changes: - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.changes.outputs.api-main }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Detect api-main changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - api-main: - - 'packages/api-main/**' - - test: - needs: detect-changes - if: needs.detect-changes.outputs.changed == 'true' - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.3.2 - - - name: Create Directory - run: mkdir -p ./packages/api-main/data/postgres_data - - - name: Install dependencies - run: bun install - - - name: Set up Docker - uses: docker/setup-docker-action@v4 - - - name: Run Docker Compose Up - working-directory: ./packages/api-main - run: docker compose -f ./docker-compose-github.yml up --build -d --wait --wait-timeout 30 - - - name: Wait for database to be ready - working-directory: ./packages/api-main - run: | - until docker exec postgres_db pg_isready -U default; do - sleep 1 - done - - - name: Push database migrations - working-directory: ./packages/api-main - run: bun run db:push:force - env: - PG_URI: postgresql://default:password@localhost:5432/postgres - - - name: Run tests - working-directory: ./packages/api-main - run: bun run test - env: - NODE_OPTIONS: --experimental-global-webcrypto - PG_URI: postgresql://default:password@localhost:5432/postgres - JWT: default_jwt_secret - JWT_STRICTNESS: lax - AUTH: whatever - - build: - needs: [detect-changes, test] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.detect-changes.outputs.changed == 'true' - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set short SHA - id: sha_short - run: echo "value=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Auth GCloud - uses: google-github-actions/auth@v2 - with: - workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.SERVICE_ACCOUNT }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v3 - - - name: Configure Docker - run: gcloud auth configure-docker ${{ secrets.REGION }}-docker.pkg.dev --quiet - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: ./packages/api-main/Dockerfile - push: true - tags: - ${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/dither-chat/api-main:${{ steps.sha_short.outputs.value }} - - notify: - needs: [build] - if: failure() && needs.build.result != 'skipped' - runs-on: ubuntu-latest - steps: - - uses: appleboy/telegram-action@v1.0.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - format: markdown - message: | - 🚨 *API Testnet Build Failed* 🚨 - - 🔗 *Repository*: [${{ github.repository }}](https://github.com/${{ github.repository }}) - 📝 *Commit*: ${{ github.event.commits[0].message }} - 👤 *Author*: ${{ github.actor }} - ⛓️‍💥 *App*: ${{ inputs.app_name }} - - 🔍 [View Logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - Please investigate and fix *ASAP*! 🔧 diff --git a/.github/workflows/testnet-feed-sync.yml b/.github/workflows/testnet-feed-sync.yml deleted file mode 100644 index 3b5267fa..00000000 --- a/.github/workflows/testnet-feed-sync.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: '[Testnet] Feed Sync' - -on: - pull_request: - branches: - - main - push: - branches: - - main - workflow_dispatch: - -jobs: - detect-changes: - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.changes.outputs.feed-sync }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Detect feed-sync changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - feed-sync: - - 'packages/feed-sync/**' - - build: - needs: [detect-changes] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.detect-changes.outputs.changed == 'true' - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set short SHA - id: sha_short - run: echo "value=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Auth GCloud - uses: google-github-actions/auth@v2 - with: - workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.SERVICE_ACCOUNT }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v3 - - - name: Configure Docker - run: gcloud auth configure-docker ${{ secrets.REGION }}-docker.pkg.dev --quiet - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: ./packages/feed-sync/Dockerfile - push: true - tags: - ${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/dither-chat/feed-sync:${{ steps.sha_short.outputs.value }} - - notify: - needs: [build] - if: failure() && needs.build.result != 'skipped' - runs-on: ubuntu-latest - steps: - - uses: appleboy/telegram-action@v1.0.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - format: markdown - message: | - 🚨 *Feed Sync Build Failed* 🚨 - - 🔗 *Repository*: [${{ github.repository }}](https://github.com/${{ github.repository }}) - 📝 *Commit*: ${{ github.event.commits[0].message }} - 👤 *Author*: ${{ github.actor }} - ⛓️‍💥 *App*: ${{ inputs.app_name }} - - 🔍 [View Logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - Please investigate and fix *ASAP*! 🔧 diff --git a/.github/workflows/testnet-reader-main.yml b/.github/workflows/testnet-reader-main.yml deleted file mode 100644 index f06dc2f1..00000000 --- a/.github/workflows/testnet-reader-main.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: '[Testnet] Reader Main' - -on: - pull_request: - branches: - - main - push: - branches: - - main - workflow_dispatch: - -jobs: - detect-changes: - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.changes.outputs.reader-main }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Detect reader-main changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - reader-main: - - 'packages/reader-main/**' - - build: - needs: [detect-changes] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.detect-changes.outputs.changed == 'true' - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set short SHA - id: sha_short - run: echo "value=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Auth GCloud - uses: google-github-actions/auth@v2 - with: - workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.SERVICE_ACCOUNT }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v3 - - - name: Configure Docker - run: gcloud auth configure-docker ${{ secrets.REGION }}-docker.pkg.dev --quiet - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: ./packages/reader-main/Dockerfile - push: true - tags: - ${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/dither-chat/reader-main:${{ steps.sha_short.outputs.value }} - - notify: - needs: [build] - if: failure() && needs.build.result != 'skipped' - runs-on: ubuntu-latest - steps: - - uses: appleboy/telegram-action@v1.0.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - format: markdown - message: | - 🚨 *Reader Main Testnet Build Failed* 🚨 - - 🔗 *Repository*: [${{ github.repository }}](https://github.com/${{ github.repository }}) - 📝 *Commit*: ${{ github.event.commits[0].message }} - 👤 *Author*: ${{ github.actor }} - ⛓️‍💥 *App*: ${{ inputs.app_name }} - - 🔍 [View Logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - Please investigate and fix *ASAP*! 🔧