|
1 | | -name: Test and Deploy |
| 1 | +name: Test |
2 | 2 |
|
3 | 3 | # Triggers on pushes to main, dev and tags. |
4 | 4 | on: |
|
56 | 56 |
|
57 | 57 | - name: Run tests |
58 | 58 | run: uv run pytest |
59 | | - |
60 | | - deploy: |
61 | | - needs: [tests] |
62 | | - runs-on: ubuntu-latest |
63 | | - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/v') |
64 | | - |
65 | | - defaults: |
66 | | - run: |
67 | | - working-directory: infrastructure/aws |
68 | | - |
69 | | - steps: |
70 | | - - uses: actions/checkout@v4 |
71 | | - |
72 | | - - name: Configure AWS credentials |
73 | | - uses: aws-actions/configure-aws-credentials@v2 |
74 | | - with: |
75 | | - role-to-assume: ${{ secrets.deploy_role_arn }} |
76 | | - role-session-name: samplerolesession |
77 | | - aws-region: us-west-2 |
78 | | - |
79 | | - - name: Set up node |
80 | | - uses: actions/setup-node@v4 |
81 | | - with: |
82 | | - node-version: '14.x' |
83 | | - |
84 | | - - name: Install cdk |
85 | | - run: npm install -g |
86 | | - |
87 | | - - name: Set up Python |
88 | | - uses: actions/setup-python@v5 |
89 | | - with: |
90 | | - python-version: '3.12' |
91 | | - |
92 | | - - name: Install dependencies |
93 | | - run: | |
94 | | - python -m pip install --upgrade pip |
95 | | - python -m pip install -r requirements-cdk.txt |
96 | | -
|
97 | | - # Build and deploy to the development environment whenever there is a push to main or dev |
98 | | - - name: Build & Deploy Development |
99 | | - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' |
100 | | - run: npm run cdk -- deploy titiler-cmr-staging --require-approval never |
101 | | - env: |
102 | | - # STACK_ALARM_EMAIL: ${{ secrets.ALARM_EMAIL }} |
103 | | - STACK_ROLE_ARN: ${{ secrets.lambda_role_arn }} |
104 | | - STACK_STAGE: staging |
105 | | - STACK_ADDITIONAL_ENV: '{"TITILER_CMR_S3_AUTH_STRATEGY":"iam", "TITILER_CMR_API_DEBUG":"TRUE"}' |
106 | | - |
107 | | - # Build and deploy to production deployment whenever there a new tag is pushed |
108 | | - - name: Build & Deploy Production |
109 | | - if: startsWith(github.ref, 'refs/tags/v') |
110 | | - run: npm run cdk -- deploy titiler-cmr-production --require-approval never |
111 | | - env: |
112 | | - # STACK_ALARM_EMAIL: ${{ secrets.ALARM_EMAIL }} |
113 | | - STACK_ROLE_ARN: ${{ secrets.lambda_role_arn }} |
114 | | - STACK_STAGE: production |
115 | | - STACK_ADDITIONAL_ENV: '{"TITILER_CMR_S3_AUTH_STRATEGY":"iam"}' |
0 commit comments