From ecfd2e1e5b5ea382bb67115cd18445b4cfdf73da Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Fri, 15 Jul 2022 19:13:50 +0100 Subject: [PATCH] refactor: remove unused .github actions --- bot/.github/workflows/build-push.yml | 48 ------- client/.github/workflows/deploy.yml | 28 ----- server/.github/test.conf.json5 | 81 ------------ .../.github/workflows/test-build-deploy.yml | 119 ------------------ 4 files changed, 276 deletions(-) delete mode 100644 bot/.github/workflows/build-push.yml delete mode 100644 client/.github/workflows/deploy.yml delete mode 100644 server/.github/test.conf.json5 delete mode 100644 server/.github/workflows/test-build-deploy.yml diff --git a/bot/.github/workflows/build-push.yml b/bot/.github/workflows/build-push.yml deleted file mode 100644 index 0c7c819e3..000000000 --- a/bot/.github/workflows/build-push.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: build & push - -on: - push: - branches: [main] - workflow_dispatch: - -jobs: - docker-push: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Docker Hub login - uses: docker/login-action@v1 - 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@v1 - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/tachi-bot:stable,${{ secrets.DOCKER_USERNAME }}/tachi-bot:${{ env.VERSION_TAG }}, - - - 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/client/.github/workflows/deploy.yml b/client/.github/workflows/deploy.yml deleted file mode 100644 index 78d20ed56..000000000 --- a/client/.github/workflows/deploy.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: deploy - -on: - push: - branches: [master, develop] - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Deploy to staging - if: github.ref == 'refs/heads/develop' - 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: github.ref == 'refs/heads/master' - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-client-deploy diff --git a/server/.github/test.conf.json5 b/server/.github/test.conf.json5 deleted file mode 100644 index 3f7c251f9..000000000 --- a/server/.github/test.conf.json5 +++ /dev/null @@ -1,81 +0,0 @@ -// Config file that the CI deployment uses. This is moved to $pwd/conf.json5 before CI tests are ran. - -{ - MONGO_DATABASE_NAME: "testingdb", - CAPTCHA_SECRET_KEY: "unused", - SESSION_SECRET: "unused", - FLO_API_URL: "https://flo.example.com", - EAG_API_URL: "https://eag.example.com", - MIN_API_URL: "https://min.example.com", - ARC_API_URL: "https://arc.example.com", - FLO_OAUTH2_INFO: { - CLIENT_ID: "DUMMY_CLIENT_ID", - CLIENT_SECRET: "DUMMY_CLIENT_SECRET", - REDIRECT_URI: "https://example.com", - }, - EAG_OAUTH2_INFO: { - CLIENT_ID: "DUMMY_CLIENT_ID", - CLIENT_SECRET: "DUMMY_CLIENT_SECRET", - REDIRECT_URI: "https://example.com", - }, - ARC_AUTH_TOKEN: "unused", - ENABLE_SERVER_HTTPS: false, - OUR_URL: "https://example.com", - INVITE_CODE_CONFIG: { - BATCH_SIZE: 2, - INVITE_CAP: 100, - BETA_USER_BONUS: 5, - }, - CDN_CONFIG: { - WEB_LOCATION: "/cdn", - SAVE_LOCATION: { - TYPE: "LOCAL_FILESYSTEM", - LOCATION: "./test-cdn", - SERVE_OWN_CDN: true, - }, - }, - TACHI_CONFIG: { - TYPE: "omni", - NAME: "Tachi Testing", - GAMES: [ - "iidx", - "museca", - "maimai", - "sdvx", - "ddr", - "bms", - "chunithm", - "usc", - "wacca", - "popn", - "jubeat", - "pms", - ], - IMPORT_TYPES: [ - "file/eamusement-iidx-csv", - "file/batch-manual", - "file/solid-state-squad", - "file/mer-iidx", - "file/pli-iidx-csv", - "ir/direct-manual", - "ir/barbatos", - "ir/fervidex", - "ir/fervidex-static", - "ir/beatoraja", - "ir/usc", - "ir/kshook-sv6c", - "api/arc-iidx", - "api/arc-sdvx", - "api/eag-iidx", - "api/eag-sdvx", - "api/flo-iidx", - "api/flo-sdvx", - "api/min-sdvx", - ], - }, - LOGGER_CONFIG: { - FILE: false, - CONSOLE: true, - LOG_LEVEL: "info", - }, -} diff --git a/server/.github/workflows/test-build-deploy.yml b/server/.github/workflows/test-build-deploy.yml deleted file mode 100644 index a634fb77e..000000000 --- a/server/.github/workflows/test-build-deploy.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Test, Build, Deploy - -on: - push: - branches: [master, develop] - pull_request: - branches: [master, develop] - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - env: - NODE_ENV: "test" - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install Node.js 16 - uses: actions/setup-node@v2 - with: - node-version: 16.x - - - name: Install PNPM - uses: pnpm/action-setup@v2.0.1 - with: - version: 6.0.2 - - - name: Install Dependencies - run: pnpm i - - # configure external dbs - - uses: supercharge/mongodb-github-action@1.4.1 - - uses: supercharge/redis-github-action@1.1.0 - - - name: Move Config File - run: mv ./.github/test.conf.json5 ./test.conf.json5 - - - name: Run Tests - run: pnpm test - env: - NODE_ENV: "test" - PORT: 8080 - MONGO_URL: "127.0.0.1" - REDIS_URL: "127.0.0.1" - - - name: Lint Code - run: pnpm lint - - - name: Typecheck Code - run: pnpm typecheck - - - name: Upload Coverage - if: always() - run: | - pnpm install -g codecov - cat coverage/lcov.info | codecov - docker-push: - runs-on: ubuntu-latest - needs: [test] - if: github.event_name == 'push' - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Docker Hub login - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Develop tag - if: github.ref == 'refs/heads/develop' - run: echo "BRANCH_TAG=develop" >> $GITHUB_ENV - - - name: Stable tag - if: github.ref == 'refs/heads/master' - 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: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/tachi-server:${{ env.BRANCH_TAG }},${{ secrets.DOCKER_USERNAME }}/tachi-server:${{ env.VERSION_TAG }}, - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - deploy: - runs-on: ubuntu-latest - needs: [docker-push] - if: github.event_name == 'push' - steps: - - name: Deploy to staging - if: github.ref == 'refs/heads/develop' - 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: github.ref == 'refs/heads/master' - uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 - with: - host: ${{ secrets.TACHI_HOST }} - username: tachi - key: ${{ secrets.TACHI_KEY }} - script: tachi-server-deploy