diff --git a/.github/workflows/api-deploy.yml b/.github/workflows/api-deploy.yml index ed7ee859..27aa702d 100644 --- a/.github/workflows/api-deploy.yml +++ b/.github/workflows/api-deploy.yml @@ -3,6 +3,7 @@ on: push: branches: - develop + - zksync-production-setup # paths: # - 'api/**' @@ -141,40 +142,40 @@ jobs: service: ${{ env.DEV_SERVICE_NAME }} cluster: ${{ env.DEV_CLUSTER }} wait-for-service-stability: true - # Deploy_Prod: - # if: github.ref == 'refs/heads/zksync-production-setup' - # runs-on: ubuntu-latest - # needs: Build - # steps: - # - name: Configure AWS credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-region: us-east-2 - # role-to-assume: arn:aws:iam::228016254426:role/Aws-GH-Action-Assume-Role-ZKSync-Production - # role-session-name: GHZKSync + Deploy_Prod: + if: github.ref == 'refs/heads/zksync-production-setup' + runs-on: ubuntu-latest + needs: Build + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: us-east-2 + role-to-assume: arn:aws:iam::228016254426:role/Aws-GH-Action-Assume-Role-ZKSync-Production + role-session-name: GHZKSync - # - name: Download task definition - # run: | - # aws ecs describe-task-definition --task-definition zksync-remix-production-rocket --query taskDefinition > task-definition.json + - name: Download task definition + run: | + aws ecs describe-task-definition --task-definition zksync-remix-production-rocket --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: "rocket" - # image: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:apiserver-${{ needs.Build.outputs.image-version }} #${{ github.run_number }} - # # inject the expected React package URL for CORS logic - # environment-variables: | - # RUST_LOG=INFO - # VITE_URL=https://cairo-remix-dev.nethermind.io - # PROMTAIL_USERNAME=${{secrets.PROMTAIL_USERNAME}} - # PROMTAIL_PASSWORD=${{secrets.PROMTAIL_PASSWORD}} + - 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: "rocket" + image: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:apiserver-${{ needs.Build.outputs.image-version }} #${{ github.run_number }} + # inject the expected React package URL for CORS logic + environment-variables: | + RUST_LOG=INFO + VITE_URL=https://cairo-remix-dev.nethermind.io + PROMTAIL_USERNAME=${{secrets.PROMTAIL_USERNAME}} + PROMTAIL_PASSWORD=${{secrets.PROMTAIL_PASSWORD}} - # - 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.PROD_SERVICE_NAME }} - # cluster: ${{ env.PROD_CLUSTER }} - # wait-for-service-stability: true + - 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.PROD_SERVICE_NAME }} + cluster: ${{ env.PROD_CLUSTER }} + wait-for-service-stability: true diff --git a/.github/workflows/remix-deploy.yml b/.github/workflows/remix-deploy.yml index dbc63cbf..7a3308b0 100644 --- a/.github/workflows/remix-deploy.yml +++ b/.github/workflows/remix-deploy.yml @@ -3,6 +3,7 @@ on: push: branches: - develop + - zksync-production-setup # paths: # - 'plugin/**' @@ -104,25 +105,25 @@ jobs: run: aws s3 sync . s3://${{ env.BUCKET_NAME }} --acl public-read working-directory: artifact - # Deploy_Prod: - # if: github.ref == 'refs/heads/zksync-production-setup' - # runs-on: ubuntu-latest - # needs: Build - # steps: + Deploy_Prod: + if: github.ref == 'refs/heads/zksync-production-setup' + runs-on: ubuntu-latest + needs: Build + steps: - # - name: Get artifact - # uses: actions/download-artifact@v3 - # with: - # name: react-github-actions-build - # path: artifact + - name: Get artifact + uses: actions/download-artifact@v3 + with: + name: react-github-actions-build + path: artifact - # - name: Configure AWS credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-region: us-east-2 - # role-to-assume: arn:aws:iam::228016254426:role/Aws-GH-Action-Assume-Role-ZKSync-Production - # role-session-name: GHZKSync + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: us-east-2 + role-to-assume: arn:aws:iam::228016254426:role/Aws-GH-Action-Assume-Role-ZKSync-Production + role-session-name: GHZKSync - # - name: Deploy to S3 - # run: aws s3 sync . s3://${{ env.PROD_BUCKET_NAME }} --acl public-read - # working-directory: artifact + - name: Deploy to S3 + run: aws s3 sync . s3://${{ env.PROD_BUCKET_NAME }} --acl public-read + working-directory: artifact