Fixed missing gateway error #320
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: Deploy Staging | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| SERVERLESS_ACCESS_KEY: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }} | |
| jobs: | |
| deploy: | |
| name: Deploy Staging | |
| runs-on: ubuntu-latest | |
| environment: staging | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-2 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run comprehensive tests | |
| run: | | |
| npm run lint:check | |
| npm run tsc | |
| # Note: Integration tests would run here if available | |
| # npm test | |
| - name: Build application | |
| run: npm run build | |
| - name: Prepare Lambda Layer | |
| run: npm run build-layer | |
| - name: Run security checks | |
| run: | | |
| npm audit --audit-level=moderate | |
| continue-on-error: true | |
| - name: Deploy Core APIs to Staging | |
| run: npx serverless deploy --stage staging --verbose | |
| - name: Verify deployment | |
| run: | | |
| echo "Deployment completed for Staging environment" | |
| npx serverless info --stage staging | |
| - name: Package deployment artifacts | |
| run: | | |
| npx serverless package --stage staging | |
| ls -R .serverless |