From 1200f00f92b500c591b59cdd8a2c73eafb379424 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 1 Apr 2024 22:01:21 +0100 Subject: [PATCH] temp: do away with all CI --- .github/workflows/bot.yml | 54 ----------- .github/workflows/client.yml | 61 ------------- .github/workflows/common.yml | 32 ------- .github/workflows/database-seeds.yml | 65 ------------- .github/workflows/docs.yml | 32 ------- .github/workflows/github-bot.yml | 54 ----------- .github/workflows/server.yml | 131 --------------------------- 7 files changed, 429 deletions(-) delete mode 100644 .github/workflows/bot.yml delete mode 100644 .github/workflows/client.yml delete mode 100644 .github/workflows/common.yml delete mode 100644 .github/workflows/database-seeds.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/github-bot.yml delete mode 100644 .github/workflows/server.yml diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml deleted file mode 100644 index c6cb43025..000000000 --- a/.github/workflows/bot.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Bot CI/CD - -on: - push: - branches: - - "release/*" - paths: - - "bot/**" - - "common/**" - workflow_dispatch: - -jobs: - docker-push: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Docker Hub login - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Version tag - run: 'echo "VERSION_TAG=$(cat package.json | grep version | head -1 | awk -F: ''{ print $2 }'' | sed ''s/[", ]//g'')" >> $GITHUB_ENV' - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v3 - with: - context: ./ - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/tachi-bot:stable,${{ secrets.DOCKER_USERNAME }}/tachi-bot:${{ env.VERSION_TAG }}, - file: ./Dockerfile.bot - cache-from: type=gha,scope=$GITHUB_REF_NAME-bot - cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-bot - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - deploy: - runs-on: ubuntu-latest - needs: [docker-push] - steps: - - name: Deploy - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-bot-deploy diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml deleted file mode 100644 index 60fb8c734..000000000 --- a/.github/workflows/client.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Client CI/CD - -on: - push: - branches: - - "staging" - - "release/*" - paths: - - "client/**" - - "common/**" - pull_request: - branches: - - "staging" - - "release/*" - paths: - - "client/**" - - "common/**" - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: pnpm/action-setup@v2 - with: - version: 7.20.0 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: pnpm - - - name: Install dependencies - run: pnpm --filter tachi-client... --filter . install - - - name: Typecheck - run: pnpm --filter tachi-client typecheck - deploy: - runs-on: ubuntu-latest - needs: [test] - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - steps: - - name: Deploy to staging - if: github.ref == 'refs/heads/staging' - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-client-deploy -s - - - name: Deploy to live - if: startsWith(github.ref, 'refs/heads/release') - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-client-deploy diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml deleted file mode 100644 index d20660046..000000000 --- a/.github/workflows/common.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Common CI/CD - -on: - push: - branches: - - "staging" - - "release/*" - paths: - - "common/**" - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: pnpm/action-setup@v2 - with: - version: 7.20.0 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: pnpm - - - name: Install dependencies - run: pnpm --filter tachi-common... --filter . install - - - name: Run Tests - run: pnpm --filter tachi-common test diff --git a/.github/workflows/database-seeds.yml b/.github/workflows/database-seeds.yml deleted file mode 100644 index 972453e68..000000000 --- a/.github/workflows/database-seeds.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Database-Seeds CI/CD - -on: - push: - branches: - - "staging" - - "release/*" - paths: - - "database-seeds/**" - - "common/**" - pull_request: - branches: - - "staging" - - "release/*" - paths: - - "database-seeds/**" - - "common/**" - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: pnpm/action-setup@v2 - with: - version: 7.20.0 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: pnpm - - - name: Install dependencies - run: pnpm --filter tachi-database-seeds-scripts... --filter . install - - - name: Run Tests - run: pnpm --filter tachi-database-seeds-scripts test - env: - NODE_ENV: "test" - - deploy: - runs-on: ubuntu-latest - needs: [test] - if: github.event_name == 'push' - steps: - - name: Sync Staging Database - if: github.ref == 'refs/heads/staging' - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-database-sync -s - - - name: Sync Live Database - if: startsWith(github.ref, 'refs/heads/release') - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-database-sync diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index d86ad68af..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Docs CI/CD - -on: - push: - branches: - - "staging" - - "release/*" - paths: - - "docs/**" - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Deploy staging docs - if: github.ref == 'refs/heads/staging' - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-docs-deploy -s - - - name: Deploy production docs - if: startsWith(github.ref, 'refs/heads/release') - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-docs-deploy diff --git a/.github/workflows/github-bot.yml b/.github/workflows/github-bot.yml deleted file mode 100644 index 7c634d19b..000000000 --- a/.github/workflows/github-bot.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: GitHub Bot CI/CD - -on: - push: - branches: - - "release/*" - paths: - - "github-bot/**" - workflow_dispatch: - -jobs: - docker-push: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Docker Hub login - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Version tag - run: 'echo "VERSION_TAG=$(cat package.json | grep version | head -1 | awk -F: ''{ print $2 }'' | sed ''s/[", ]//g'')" >> $GITHUB_ENV' - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v3 - with: - context: ./ - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/tachi-gh-bot:stable,${{ secrets.DOCKER_USERNAME }}/tachi-gh-bot:${{ env.VERSION_TAG }} - file: ./Dockerfile.ghbot - cache-from: type=gha,scope=$GITHUB_REF_NAME-github-bot - cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-github-bot - - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - deploy: - runs-on: ubuntu-latest - needs: [docker-push] - steps: - - name: Deploy - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-github-bot-deploy diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml deleted file mode 100644 index fb88ff1b2..000000000 --- a/.github/workflows/server.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Server CI/CD - -on: - push: - branches: - - "staging" - - "release/*" - paths: - - "server/**" - - "common/**" - pull_request: - branches: - - "staging" - - "release/*" - paths: - - "server/**" - - "common/**" - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - env: - NODE_ENV: "test" - steps: - - uses: actions/checkout@v3 - - - uses: pnpm/action-setup@v2 - with: - version: 7.20.0 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: pnpm - - - name: Install dependencies - run: pnpm --filter tachi-server... --filter . install - - # configure external dbs - - uses: supercharge/mongodb-github-action@1.4.1 - - uses: supercharge/redis-github-action@1.1.0 - - - name: Run tests - run: pnpm --filter tachi-server test - env: - NODE_ENV: "test" - PORT: 8080 - MONGO_URL: "127.0.0.1" - REDIS_URL: "127.0.0.1" - - - name: Lint code - run: pnpm --filter tachi-server lint - - - name: Typecheck code - run: pnpm --filter tachi-server typecheck - docker-push: - runs-on: ubuntu-latest - needs: [test] - defaults: - run: - working-directory: ./server - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Docker Hub login - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Develop tag - if: github.ref == 'refs/heads/staging' - run: echo "BRANCH_TAG=develop" >> $GITHUB_ENV - - - name: Stable tag - if: startsWith(github.ref, 'refs/heads/release') - run: echo "BRANCH_TAG=stable" >> $GITHUB_ENV - - - name: Version tag - run: 'echo "VERSION_TAG=$(cat package.json | grep version | head -1 | awk -F: ''{ print $2 }'' | sed ''s/[", ]//g'')" >> $GITHUB_ENV' - - - name: Commit Hash - run: 'echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV' - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v3 - with: - context: ./ - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/tachi-server:${{ env.BRANCH_TAG }},${{ secrets.DOCKER_USERNAME }}/tachi-server:${{ env.VERSION_TAG }} - file: ./Dockerfile.server - build-args: | - COMMIT_HASH=${{ env.SHORT_SHA }} - cache-from: type=gha,scope=$GITHUB_REF_NAME-server - cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-server - - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - deploy: - runs-on: ubuntu-latest - needs: [docker-push] - defaults: - run: - working-directory: ./server - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - steps: - - name: Deploy to staging - if: github.ref == 'refs/heads/staging' - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-server-deploy -s - - - name: Deploy to live - if: startsWith(github.ref, 'refs/heads/release') - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-server-deploy