Alex Rayo
04/21/2022, 2:20 PMthdxr
04/21/2022, 2:23 PMthdxr
04/21/2022, 2:23 PM--stage
appropriatelythdxr
04/21/2022, 2:24 PMname: sst
on:
workflow_dispatch:
push:
paths:
* "backend/**"
* "solid/**"
* "web/**"
* "stacks/**"
* ".github/workflows/sst.yaml"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
* name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
* uses: actions/checkout@v2
with:
fetch-depth: 0
* uses: actions/setup-node@v1
with:
node-version: "14"
* uses: actions/cache@v2
name: Cache
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
* name: Install Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
* name: Typecheck
run: yarn turbo run typecheck
* if: github.ref != 'refs/heads/production'
name: Configure Dev AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::386334411894:role/github
aws-region: us-east-1
* 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::706616489477:role/github
aws-region: us-east-1
* name: Deploy
run: yarn sst deploy --stage=${GITHUB_REF_NAME}
* name: Test
if: github.ref != 'refs/heads/production'
run: cd backend && SSM_PREFIX=/bumi/${GITHUB_REF_NAME}/ SSM_FALLBACK=/bumi/fallback/ SSM_VALUES=* yarn vitest
Alex Rayo
04/21/2022, 2:28 PM