$ name: Deploy to Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '20' cache: '-weight: 500;">npm' - name: Install dependencies run: -weight: 500;">npm ci - name: Run tests run: -weight: 500;">npm test - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 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 id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - name: Build Docker image env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} IMAGE_TAG: ${{ github.sha }} run: | -weight: 500;">docker build -t $ECR_REGISTRY/my-app:$IMAGE_TAG . -weight: 500;">docker push $ECR_REGISTRY/my-app:$IMAGE_TAG echo "IMAGE=$ECR_REGISTRY/my-app:$IMAGE_TAG" >> $GITHUB_ENV - name: Download task definition run: | aws ecs describe-task-definition --task-definition my-app \ --query taskDefinition > task-definition.json - name: Update ECS task definition id: task-def uses: aws-actions/amazon-ecs-render-task-definition@v1 with: task-definition: task-definition.json container-name: my-app image: ${{ env.IMAGE }} - name: Deploy to ECS uses: aws-actions/amazon-ecs-deploy-task-definition@v1 with: task-definition: ${{ steps.task-def.outputs.task-definition }} -weight: 500;">service: my-app--weight: 500;">service cluster: my-app-cluster wait-for--weight: 500;">service-stability: true - name: Notify on failure if: failure() run: | -weight: 500;">curl -X POST ${{ secrets.SLACK_WEBHOOK_URL }} \ -H 'Content-type: application/json' \ --data '{"text":"Deploy failed! Check Actions."}'
name: Deploy to Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '20' cache: '-weight: 500;">npm' - name: Install dependencies run: -weight: 500;">npm ci - name: Run tests run: -weight: 500;">npm test - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 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 id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - name: Build Docker image env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} IMAGE_TAG: ${{ github.sha }} run: | -weight: 500;">docker build -t $ECR_REGISTRY/my-app:$IMAGE_TAG . -weight: 500;">docker push $ECR_REGISTRY/my-app:$IMAGE_TAG echo "IMAGE=$ECR_REGISTRY/my-app:$IMAGE_TAG" >> $GITHUB_ENV - name: Download task definition run: | aws ecs describe-task-definition --task-definition my-app \ --query taskDefinition > task-definition.json - name: Update ECS task definition id: task-def uses: aws-actions/amazon-ecs-render-task-definition@v1 with: task-definition: task-definition.json container-name: my-app image: ${{ env.IMAGE }} - name: Deploy to ECS uses: aws-actions/amazon-ecs-deploy-task-definition@v1 with: task-definition: ${{ steps.task-def.outputs.task-definition }} -weight: 500;">service: my-app--weight: 500;">service cluster: my-app-cluster wait-for--weight: 500;">service-stability: true - name: Notify on failure if: failure() run: | -weight: 500;">curl -X POST ${{ secrets.SLACK_WEBHOOK_URL }} \ -H 'Content-type: application/json' \ --data '{"text":"Deploy failed! Check Actions."}'
name: Deploy to Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '20' cache: '-weight: 500;">npm' - name: Install dependencies run: -weight: 500;">npm ci - name: Run tests run: -weight: 500;">npm test - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 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 id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - name: Build Docker image env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} IMAGE_TAG: ${{ github.sha }} run: | -weight: 500;">docker build -t $ECR_REGISTRY/my-app:$IMAGE_TAG . -weight: 500;">docker push $ECR_REGISTRY/my-app:$IMAGE_TAG echo "IMAGE=$ECR_REGISTRY/my-app:$IMAGE_TAG" >> $GITHUB_ENV - name: Download task definition run: | aws ecs describe-task-definition --task-definition my-app \ --query taskDefinition > task-definition.json - name: Update ECS task definition id: task-def uses: aws-actions/amazon-ecs-render-task-definition@v1 with: task-definition: task-definition.json container-name: my-app image: ${{ env.IMAGE }} - name: Deploy to ECS uses: aws-actions/amazon-ecs-deploy-task-definition@v1 with: task-definition: ${{ steps.task-def.outputs.task-definition }} -weight: 500;">service: my-app--weight: 500;">service cluster: my-app-cluster wait-for--weight: 500;">service-stability: true - name: Notify on failure if: failure() run: | -weight: 500;">curl -X POST ${{ secrets.SLACK_WEBHOOK_URL }} \ -H 'Content-type: application/json' \ --data '{"text":"Deploy failed! Check Actions."}'
-weight: 500;">npm -weight: 500;">install -g @nexusai/cli
nexus login
-weight: 500;">npm -weight: 500;">install -g @nexusai/cli
nexus login
-weight: 500;">npm -weight: 500;">install -g @nexusai/cli
nexus login
nexus deploy source \ --repo https://github.com/myorg/my-app \ --name my-app \ --provider aws_ecs_fargate
nexus deploy source \ --repo https://github.com/myorg/my-app \ --name my-app \ --provider aws_ecs_fargate
nexus deploy source \ --repo https://github.com/myorg/my-app \ --name my-app \ --provider aws_ecs_fargate
name: Deploy to Production on: push: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' cache: '-weight: 500;">npm' - run: -weight: 500;">npm ci - run: -weight: 500;">npm test deploy: needs: test runs-on: ubuntu-latest steps: - name: Deploy run: nexus deploy redeploy --deployment-id ${{ secrets.NEXUSAI_DEPLOYMENT_ID }} env: NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
name: Deploy to Production on: push: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' cache: '-weight: 500;">npm' - run: -weight: 500;">npm ci - run: -weight: 500;">npm test deploy: needs: test runs-on: ubuntu-latest steps: - name: Deploy run: nexus deploy redeploy --deployment-id ${{ secrets.NEXUSAI_DEPLOYMENT_ID }} env: NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
name: Deploy to Production on: push: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' cache: '-weight: 500;">npm' - run: -weight: 500;">npm ci - run: -weight: 500;">npm test deploy: needs: test runs-on: ubuntu-latest steps: - name: Deploy run: nexus deploy redeploy --deployment-id ${{ secrets.NEXUSAI_DEPLOYMENT_ID }} env: NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
nexus secret set \ DATABASE_URL=postgres://user:pass@host/db \ STRIPE_SECRET_KEY=sk_live_... \ NODE_ENV=production
nexus secret set \ DATABASE_URL=postgres://user:pass@host/db \ STRIPE_SECRET_KEY=sk_live_... \ NODE_ENV=production
nexus secret set \ DATABASE_URL=postgres://user:pass@host/db \ STRIPE_SECRET_KEY=sk_live_... \ NODE_ENV=production
nexus deploy redeploy --deployment-id <your-deployment-id>
nexus deploy redeploy --deployment-id <your-deployment-id>
nexus deploy redeploy --deployment-id <your-deployment-id>
nexus deploy rollback --deployment-id <your-deployment-id>
nexus deploy rollback --deployment-id <your-deployment-id>
nexus deploy rollback --deployment-id <your-deployment-id>
# Install
-weight: 500;">npm -weight: 500;">install -g @nexusai/cli # Authenticate
nexus login # First deploy — detects Node/Python/Go automatically, no Dockerfile needed
nexus deploy source \ --repo https://github.com/your/repo \ --name my-app \ --provider aws_ecs_fargate # or gcp_cloud_run, azure_container_apps # Check -weight: 500;">status
nexus deploy -weight: 500;">status --deployment-id <id> # Set environment variables
nexus secret set KEY=value KEY2=value2 # Redeploy (use this in CI)
nexus deploy redeploy --deployment-id <id> # Rollback
nexus deploy rollback --deployment-id <id>
# Install
-weight: 500;">npm -weight: 500;">install -g @nexusai/cli # Authenticate
nexus login # First deploy — detects Node/Python/Go automatically, no Dockerfile needed
nexus deploy source \ --repo https://github.com/your/repo \ --name my-app \ --provider aws_ecs_fargate # or gcp_cloud_run, azure_container_apps # Check -weight: 500;">status
nexus deploy -weight: 500;">status --deployment-id <id> # Set environment variables
nexus secret set KEY=value KEY2=value2 # Redeploy (use this in CI)
nexus deploy redeploy --deployment-id <id> # Rollback
nexus deploy rollback --deployment-id <id>
# Install
-weight: 500;">npm -weight: 500;">install -g @nexusai/cli # Authenticate
nexus login # First deploy — detects Node/Python/Go automatically, no Dockerfile needed
nexus deploy source \ --repo https://github.com/your/repo \ --name my-app \ --provider aws_ecs_fargate # or gcp_cloud_run, azure_container_apps # Check -weight: 500;">status
nexus deploy -weight: 500;">status --deployment-id <id> # Set environment variables
nexus secret set KEY=value KEY2=value2 # Redeploy (use this in CI)
nexus deploy redeploy --deployment-id <id> # Rollback
nexus deploy rollback --deployment-id <id> - An ECR repository I had to provision manually
- An ECS cluster, -weight: 500;">service, and task definition I had to set up in the console
- IAM roles with the exact right permissions (I guessed wrong twice)
- A Dockerfile I maintained separately
- AWS credentials rotated manually every 90 days - Reads your repo — detects the runtime from package.json, requirements.txt, go.mod, etc.
- Builds the container on NEXUS AI's build infrastructure — not your machine, not a GitHub runner
- Pushes the image to an ECR repository it provisions in your account
- Creates (or updates) the ECS infrastructure — cluster, task definition, -weight: 500;">service, load balancer
- Issues a TLS certificate via ACM and wires it to the load balancer
- Waits for health checks to pass before returning the live URL