Skip to content

Commit 2d6b6d8

Browse files
committed
move aws deploy in its own workflow
1 parent 4f7b8dd commit 2d6b6d8

File tree

2 files changed

+69
-58
lines changed

2 files changed

+69
-58
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -172,61 +172,3 @@ jobs:
172172
labels: ${{ steps.meta.outputs.labels }}
173173
cache-from: type=gha
174174
cache-to: type=gha,mode=max
175-
176-
deploy:
177-
needs: [tests, publish]
178-
runs-on: ubuntu-latest
179-
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' && github.repository == 'developmentseed/titiler'
180-
181-
defaults:
182-
run:
183-
working-directory: deployment/aws
184-
185-
steps:
186-
- uses: actions/checkout@v5
187-
188-
# Let's wait a bit to make sure Pypi is up to date
189-
- name: Sleep for 120 seconds
190-
run: sleep 120s
191-
shell: bash
192-
193-
- name: Configure AWS credentials
194-
uses: aws-actions/configure-aws-credentials@v5
195-
with:
196-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
197-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
198-
aws-region: us-east-1
199-
200-
- name: Set up Node.js
201-
uses: actions/setup-node@v5
202-
with:
203-
node-version: '24.x'
204-
205-
- name: Install cdk
206-
run: npm install -g
207-
208-
- name: Set up Python
209-
uses: actions/setup-python@v6
210-
with:
211-
python-version: '3.x'
212-
213-
- name: Install dependencies
214-
run: |
215-
python -m pip install --upgrade pip
216-
python -m pip install -r requirements-cdk.txt
217-
218-
# Let's wait a bit to make sure package is available on pypi
219-
- name: Sleep for 120 seconds
220-
run: sleep 120s
221-
shell: bash
222-
223-
# Build and Deploy CDK application
224-
- name: Build & Deploy
225-
run: npm run cdk -- deploy ${{ secrets.STACK_NAME }}-lambda-${{ secrets.STACK_STAGE }} --require-approval never
226-
env:
227-
TITILER_STACK_NAME: ${{ secrets.STACK_NAME }}
228-
TITILER_STACK_STAGE: ${{ secrets.STACK_STAGE }}
229-
TITILER_STACK_MEMORY: ${{ secrets.STACK_MEMORY }}
230-
TITILER_STACK_OWNER: ${{ secrets.STACK_OWNER }}
231-
TITILER_STACK_CLIENT: ${{ secrets.STACK_CLIENT }}
232-
TITILER_STACK_BUCKETS: ${{ secrets.STACK_BUCKETS }}

.github/workflows/deploy.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
# On every pull request, but only on push to main
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
workflow_dispatch:
9+
workflow_run:
10+
workflows: ["ci"] # Name of the workflow to listen for
11+
types:
12+
- completed
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'refs/tags') && github.repository == 'developmentseed/titiler' }}
18+
defaults:
19+
run:
20+
working-directory: deployment/aws
21+
22+
steps:
23+
- uses: actions/checkout@v5
24+
25+
# Let's wait a bit to make sure Pypi is up to date
26+
- name: Sleep for 120 seconds
27+
run: sleep 120s
28+
shell: bash
29+
30+
- name: Configure AWS credentials
31+
uses: aws-actions/configure-aws-credentials@v5
32+
with:
33+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
34+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35+
aws-region: us-east-1
36+
37+
- name: Set up Node.js
38+
uses: actions/setup-node@v5
39+
with:
40+
node-version: '24.x'
41+
42+
- name: Install cdk
43+
run: npm install -g
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v6
47+
with:
48+
python-version: '3.x'
49+
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
python -m pip install -r requirements-cdk.txt
54+
55+
# Let's wait a bit to make sure package is available on pypi
56+
- name: Sleep for 120 seconds
57+
run: sleep 120s
58+
shell: bash
59+
60+
# Build and Deploy CDK application
61+
- name: Build & Deploy
62+
run: npm run cdk -- deploy ${{ secrets.STACK_NAME }}-lambda-${{ secrets.STACK_STAGE }} --require-approval never
63+
env:
64+
TITILER_STACK_NAME: ${{ secrets.STACK_NAME }}
65+
TITILER_STACK_STAGE: ${{ secrets.STACK_STAGE }}
66+
TITILER_STACK_MEMORY: ${{ secrets.STACK_MEMORY }}
67+
TITILER_STACK_OWNER: ${{ secrets.STACK_OWNER }}
68+
TITILER_STACK_CLIENT: ${{ secrets.STACK_CLIENT }}
69+
TITILER_STACK_BUCKETS: ${{ secrets.STACK_BUCKETS }}

0 commit comments

Comments
 (0)