From 5314b72c45e8cf4987c19e1885e97ec27007c7ba Mon Sep 17 00:00:00 2001 From: CapCap Date: Sat, 24 Sep 2022 21:38:12 -0700 Subject: [PATCH] remove build --- .../deploy-community-platform-to-prod.yaml | 19 ------ .../deploy-community-platform-to-staging.yaml | 27 --------- .../workflows/deploy-community-platform.yaml | 58 ------------------ .github/workflows/docker-build-test.yaml | 28 --------- .github/workflows/lint-test.yaml | 60 ------------------- 5 files changed, 192 deletions(-) delete mode 100644 .github/workflows/deploy-community-platform-to-prod.yaml delete mode 100644 .github/workflows/deploy-community-platform-to-staging.yaml delete mode 100644 .github/workflows/deploy-community-platform.yaml diff --git a/.github/workflows/deploy-community-platform-to-prod.yaml b/.github/workflows/deploy-community-platform-to-prod.yaml deleted file mode 100644 index d78de315c81d5..0000000000000 --- a/.github/workflows/deploy-community-platform-to-prod.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Deploy community-platform to prod -on: - push: - branches: - - main - paths: - - "ecosystem/platform/server/**" - workflow_dispatch: - -permissions: - contents: read - id-token: write - -jobs: - deploy: - uses: ./.github/workflows/deploy-community-platform.yaml - with: - aptos_env: prod - secrets: inherit diff --git a/.github/workflows/deploy-community-platform-to-staging.yaml b/.github/workflows/deploy-community-platform-to-staging.yaml deleted file mode 100644 index 2056426734c11..0000000000000 --- a/.github/workflows/deploy-community-platform-to-staging.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Deploy community-platform to staging -on: - push: - branches: - - main - paths: - - "ecosystem/platform/server/**" - workflow_dispatch: - # allow deployment to staging from pull request when special label is applied - # TODO: create proper dev environment and only allow this for dev environment - reserve staging to reflect state of main branch. - pull_request: - types: [labeled, opened, synchronize, reopened] - -permissions: - contents: read - id-token: write - -jobs: - deploy: - if: | - github.event_name == 'push' || - github.event_name == 'workflow_dispatch' || - contains(github.event.pull_request.labels.*.name, 'CICD:deploy-community-platform-to-staging') - uses: ./.github/workflows/deploy-community-platform.yaml - with: - aptos_env: staging - secrets: inherit diff --git a/.github/workflows/deploy-community-platform.yaml b/.github/workflows/deploy-community-platform.yaml deleted file mode 100644 index 480ca3aede964..0000000000000 --- a/.github/workflows/deploy-community-platform.yaml +++ /dev/null @@ -1,58 +0,0 @@ -on: - workflow_call: - inputs: - aptos_env: - required: true - type: string - description: "the environment to deploy into, must be: prod|staging|dev" - -permissions: - contents: read - id-token: write - -# only allow one in-flight deployment per environment -concurrency: - group: ${{ inputs.aptos_env }} - -env: - # this expression is only useful if we deploy from a PR directly, which we sometimes may do during development and maybe in future for the dev environment - # but let's keep it here for now to enable these scenarios. For more info on what this expression is doing check the comments in the ./build-images.yaml workflow. - GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - -jobs: - deploy: - runs-on: ubuntu-latest - environment: - name: community-platform-${{ inputs.aptos_env }} - url: ${{ inputs.aptos_env == 'prod' && 'https://community.aptoslabs.com' || format('https://community.{0}.gcp.aptosdev.com', inputs.aptos_env) }} - - steps: - - name: Wait for images to have been built - timeout-minutes: 10 - uses: lewagon/wait-on-check-action@v1.0.0 - with: - ref: ${{ env.GIT_SHA }} - check-regexp: "community-platform.*" - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - id: auth - uses: "google-github-actions/auth@v0" - with: - workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} - - - id: deploy-app - uses: "google-github-actions/deploy-cloudrun@v0" - with: - service: community - image: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/community-platform:${{ env.GIT_SHA }} - project_id: aptos-community-${{ inputs.aptos_env }} - region: us-west1 - - - id: deploy-worker - uses: "google-github-actions/deploy-cloudrun@v0" - with: - service: community-worker - image: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/community-platform:${{ env.GIT_SHA }} - project_id: aptos-community-${{ inputs.aptos_env }} - region: us-west1 diff --git a/.github/workflows/docker-build-test.yaml b/.github/workflows/docker-build-test.yaml index f545e43b3079d..c243a962ac942 100644 --- a/.github/workflows/docker-build-test.yaml +++ b/.github/workflows/docker-build-test.yaml @@ -74,7 +74,6 @@ jobs: github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'CICD:build-images') || contains(github.event.pull_request.labels.*.name, 'CICD:run-e2e-tests') || - contains(github.event.pull_request.labels.*.name, 'CICD:deploy-community-platform-to-staging') || github.event.pull_request.auto_merge != null || contains(github.event.pull_request.body, '#e2e') runs-on: ubuntu-latest @@ -194,30 +193,3 @@ jobs: # test lifecycle is separate from that of GHA. This protects us from the case where many Forge tests are triggered # by this GHA. If there is a Forge namespace collision, Forge will pre-empt the existing test running in the namespace. FORGE_NAMESPACE: forge-compat-${{ needs.determine-docker-build-metadata.outputs.targetCacheId }} - - community-platform: - needs: [permission-check] - runs-on: high-perf-docker - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ env.GIT_SHA }} - - - uses: ./.github/actions/gar-auth - with: - GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - GCP_SERVICE_ACCOUNT_EMAIL: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} - - - name: Login to ECR - uses: docker/login-action@v2 - with: - registry: ${{ secrets.ENV_ECR_AWS_ACCOUNT_NUM }}.dkr.ecr.us-west-2.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - - uses: ./.github/actions/docker-buildx-setup - - - name: Build and Push Community Platform image - run: | - cd ecosystem/platform/server - docker buildx bake --progress=plain --push -f ./docker-bake.hcl diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index d224893a67a1e..36c7e213de1d6 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -51,66 +51,6 @@ jobs: - run: cd ./ecosystem/typescript/sdk && yarn lint - run: cd ./ecosystem/typescript/sdk && yarn fmt:check - community-platform-lint: - runs-on: ubuntu-latest - env: - RAILS_ENV: test - NODE_ENV: test - defaults: - run: - working-directory: ecosystem/platform/server - steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - working-directory: ecosystem/platform/server - bundler-cache: true - - uses: actions/setup-node@v3 - with: - node-version-file: .node-version - - run: yarn install --frozen-lockfile - - run: yarn run prettier --check . - - run: yarn run tsc - - run: bundle exec bundler-audit --update - - run: bundle exec brakeman -q -w2 - - run: bundle exec rubocop - - run: bundle exec erblint --lint-all - - community-platform-test: - runs-on: ubuntu-latest - services: - postgres: - image: postgres:11-alpine - ports: - - "5432:5432" - env: - POSTGRES_USER: complat - POSTGRES_PASSWORD: password - env: - RAILS_ENV: test - NODE_ENV: test - CI: true - COMMUNITY_DB_USER: complat - COMMUNITY_DB_PASS: password - COMMUNITY_DB_HOST: localhost - COMMUNITY_DB_PORT: 5432 - defaults: - run: - working-directory: ecosystem/platform/server - steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - working-directory: ecosystem/platform/server - bundler-cache: true - - uses: actions/setup-node@v3 - with: - node-version-file: .node-version - - run: bin/setup - - run: yarn build - - run: yarn build:css - - run: bin/rails test - docs-lint: runs-on: ubuntu-latest steps: