-
Notifications
You must be signed in to change notification settings - Fork 47
72 lines (58 loc) · 1.92 KB
/
sst.yaml
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
67
68
69
70
71
72
name: sst
on:
workflow_dispatch:
push:
branches:
- production
- dev
concurrency:
group: ${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
.sst
key: ${{ runner.os }}-sst
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: actions/setup-node@v1
with:
node-version: "20"
- run: "curl -fsSL https://ion.sst.dev/install | bash"
- if: github.ref == 'refs/heads/dev'
name: Configure Dev AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::058264103289:role/terminal-shop-dev-github
aws-region: us-east-2
- if: github.ref == 'refs/heads/production'
name: Configure Production AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::211125775473:role/terminal-shop-production-github
aws-region: us-east-2
- name: deps
run: bun install
- name: typecheck
run: bun typecheck
- name: Deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
STRIPE_API_KEY: ${{ github.ref == 'refs/heads/production' && secrets.PRODUCTION_STRIPE_API_KEY || secrets.DEV_STRIPE_API_KEY }}
PLANETSCALE_SERVICE_TOKEN_NAME: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_NAME }}
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
run: |
sst install
echo "${{ secrets.SSH_PRIVATE_KEY }}" >> ./packages/go/id_ed25519
echo "${{ secrets.SSH_PUBLIC_KEY }}" >> ./packages/go/id_ed25519.pub
sst deploy --stage=${GITHUB_REF_NAME}