feat: add user account approval with admin review UI (#2145) #62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Web Sync Server deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/web-sync-server*" | |
| - "moon/apps/sync-server/**" | |
| - "moon/packages/editor/**" | |
| - "moon/packages/config/**" | |
| - "moon/packages/types/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY_ALIAS: m8q5m4u3 | |
| REPOSITORY: mega/web-sync-server | |
| IMAGE_TAG: latest | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Login to Amazon ECR Public | |
| id: login-ecr-public | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| with: | |
| registry-type: public | |
| - name: Build, tag, and push docker image to Amazon ECR Public | |
| working-directory: moon | |
| env: | |
| REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} | |
| run: | | |
| set -euo pipefail | |
| AWS_IMAGE_BASE="$REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}" | |
| IMAGE_TAG="${{ env.IMAGE_TAG }}" | |
| SHORT_SHA="${GITHUB_SHA:0:7}" | |
| docker build \ | |
| -f apps/sync-server/Dockerfile \ | |
| -t "$AWS_IMAGE_BASE:$IMAGE_TAG" . | |
| docker tag "$AWS_IMAGE_BASE:$IMAGE_TAG" "$AWS_IMAGE_BASE:$SHORT_SHA" | |
| # Push to AWS ECR Public (latest + commit hash) | |
| docker push "$AWS_IMAGE_BASE:$IMAGE_TAG" | |
| docker push "$AWS_IMAGE_BASE:$SHORT_SHA" | |
| deploy-aws: | |
| needs: build-and-push | |
| if: ${{ github.repository == 'gitmono-dev/mega' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - cluster: gitmega-com | |
| service: mega-web-sync-server-dev-service-v3hdlyk8 | |
| # TODO: update service name to actual gitmono sync server ECS service | |
| - cluster: gitmono-com-mega-app | |
| service: mega-web-sync-service | |
| steps: | |
| - name: Force ECS redeploy | |
| run: | | |
| aws ecs update-service \ | |
| --cluster ${{ matrix.cluster }} \ | |
| --service ${{ matrix.service }} \ | |
| --force-new-deployment | |
| env: | |
| AWS_REGION: ap-southeast-2 | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |