-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (61 loc) · 1.88 KB
/
sst.deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: SST Deploy
on:
workflow_call:
inputs:
environment:
description: "GitHub environment name"
required: true
type: string
sst-stage:
description: "SST deployment stage"
required: true
type: string
secrets:
CLOUDFLARE_API_TOKEN:
required: true
DATABASE_URL:
required: true
SG_CARS_TRENDS_API_TOKEN:
required: true
UPSTASH_REDIS_REST_TOKEN:
required: true
UPSTASH_REDIS_REST_URL:
required: true
permissions:
id-token: write
contents: read
packages: read
jobs:
sst-deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
SG_CARS_TRENDS_API_TOKEN: ${{ secrets.SG_CARS_TRENDS_API_TOKEN }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
FEATURE_FLAG_RATE_LIMIT: ${{ vars.FEATURE_FLAG_RATE_LIMIT }}
# Concurrency group name ensures concurrent workflow runs wait for any in-progress job to finish
concurrency:
group: merge-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: latest
cache: "pnpm"
- name: Install dependencies
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" >> .npmrc # Add auth token to .npmrc
pnpm install
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ROLE_TO_ASSUME }}
aws-region: ${{ vars.AWS_REGION }}
- name: Deploy app
run: |
pnpm sst deploy --stage ${{ inputs.sst-stage }}