-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.21 KB
/
main.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
name: One-off Deploy
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Next.js Build
uses: actions/cache@v4
with:
path: |
.next/
.open-next/
.sst/
key: cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles("**.[jt]s', '**.[jt]xs', ) }}
restore-keys: |
cache-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Install AWS Creds
run: |
mkdir -p ~/.aws
echo "[default]" > ~/.aws/credentials
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials
- name: Set SST Config Secret
run: |
npx sst secret set COMMIT_SHA ${{ github.sha }} --stage production
- name: Deploy with SST
run: pnpm run deploy
- name: Clean up AWS Profile
run: rm -rf ~/.aws