diff --git a/.env.qa b/.env.qa new file mode 100644 index 00000000..8abeaed4 --- /dev/null +++ b/.env.qa @@ -0,0 +1,15 @@ +NEXT_PUBLIC_ENV=testnet +NEXT_PUBLIC_RIF_WALLET_SERVICES=https://dev.rws.app.rootstockcollective.xyz +NEXT_PUBLIC_EXPLORER=https://explorer.testnet.rootstock.io +NEXT_PUBLIC_BUILD_ID= + +NEXT_PUBLIC_RIF_ADDRESS=0x19f64674d8a5b4e652319f5e239efd3bc969a1fe +NEXT_PUBLIC_STRIF_ADDRESS=0x7C19923bac1b41e9bBD1c33815A61854beeD9b54 +NEXT_PUBLIC_GOVERNOR_ADDRESS=0x0DB02C99619bB0E6d2cBeF5545Cc968DAb724E10 +NEXT_PUBLIC_EA_NFT_ADDRESS=0xa060A65967cb9b9511E3A4ec091Aa81c6dCe6662 +NEXT_PUBLIC_MULTICALL_ADDRESS=0xcA11bde05977b3631167028862bE2a173976CA11 +NEXT_PUBLIC_GRANTS_BUCKET_ADDRESS=0xfaca664c661af7e0e630c8f92b401012cd2a30ef +NEXT_PUBLIC_GRANTS_ACTIVE_BUCKET_ADDRESS=0x2217E4d3Ae0A6E30075D1B5a7b8C1520E8009f49 +NEXT_PUBLIC_GROWTH_BUCKET_ADDRESS=0x420f39968009a0e8693a0e1bba633cd99eaffb9b +NEXT_PUBLIC_GENERAL_BUCKET_ADDRESS=0x72Ed7d7b7835Ad62B1f9b6280bAd62618aA71461 +NEXT_PUBLIC_CHAIN_ID=31 \ No newline at end of file diff --git a/.github/workflows/dev.deploy.yaml b/.github/workflows/dev.deploy.yaml index d499bbe7..6b611eaa 100644 --- a/.github/workflows/dev.deploy.yaml +++ b/.github/workflows/dev.deploy.yaml @@ -7,11 +7,11 @@ on: env: AWS_REGION: us-east-1 - ECR_REPOSITORY: dao-frontend-dev - ECS_CLUSTER: dao-frontend - ECS_SERVICE: dao-frontend-dev - ECS_TASK_DEFINITION: dao-frontend-dev - CONTAINER_NAME: dao-frontend-dev + ECR_REPOSITORY: rscoll-dev-dao-dev + ECS_CLUSTER: rscoll-dev + ECS_SERVICE: rscoll-dev-dao-dev + ECS_TASK_DEFINITION: rscoll-dev-dao-dev + CONTAINER_NAME: rscoll-dev-dao-dev PROFILE: dev diff --git a/.github/workflows/staging.deploy.yaml b/.github/workflows/staging.deploy.yaml new file mode 100644 index 00000000..f72ea3fc --- /dev/null +++ b/.github/workflows/staging.deploy.yaml @@ -0,0 +1,73 @@ +name: Deploy to Amazon ECS (staging) + +on: + push: + branches: + - develop + +env: + AWS_REGION: us-east-1 + ECR_REPOSITORY: rscoll-dev-dao-staging + ECS_CLUSTER: rscoll-dev + ECS_SERVICE: rscoll-dev-dao-staging + ECS_TASK_DEFINITION: rscoll-dev-dao-staging + CONTAINER_NAME: rscoll-dev-dao-staging + + PROFILE: qa + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + environment: + name: staging + + permissions: + id-token: write + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_LOGIN_STAGING_ROLE_ARN }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Build, tag, and push image to Amazon ECR + id: build-image + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + IMAGE_TAG: ${{ github.sha }} + run: | + # Build a docker container and + # push it to ECR so that it can + # be deployed to ECS. + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --build-arg arg_env="$PROFILE" --build-arg NEXT_PUBLIC_BUILD_ID=${{ github.sha }} --no-cache . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + + - name: Download task definition + run: aws ecs describe-task-definition --task-definition ${{ env.ECS_TASK_DEFINITION }} --query taskDefinition > task-definition.json + + - name: Fill in the new image ID in the Amazon ECS task definition + id: task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: task-definition.json + container-name: ${{ env.CONTAINER_NAME }} + image: ${{ steps.build-image.outputs.image }} + + - name: Deploy Amazon ECS task definition + uses: aws-actions/amazon-ecs-deploy-task-definition@v1 + with: + task-definition: ${{ steps.task-def.outputs.task-definition }} + service: ${{ env.ECS_SERVICE }} + cluster: ${{ env.ECS_CLUSTER }} + wait-for-service-stability: true diff --git a/Dockerfile b/Dockerfile index 22c7463b..1b8f4cc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,8 @@ RUN if [ "$arg_env" = "testnet" ]; then \ mv .env.testnet .env.local; \ elif [ "$arg_env" = "dev" ]; then \ mv .env.dev .env.local; \ + elif [ "$arg_env" = "qa" ]; then \ + mv .env.qa .env.local; \ elif [ "$arg_env" = "mainnet" ]; then \ mv .env.prod .env.local; \ fi