Merge pull request #78 from TigerAppsOrg/dependabot/npm_and_yarn/mult… #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SST CD | |
on: | |
push: | |
branches: | |
- main | |
# Concurrency group name ensures concurrent workflow | |
# runs wait for any in-progress job to finish | |
concurrency: | |
group: merge-${{ github.ref }} | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
TestBuild: | |
runs-on: ubuntu-latest | |
env: | |
PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.PUBLIC_SUPABASE_ANON_KEY }} | |
PUBLIC_SUPABASE_URL: ${{ secrets.PUBLIC_SUPABASE_URL }} | |
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }} | |
SERVICE_KEY: ${{ secrets.SERVICE_KEY }} | |
API_ACCESS_TOKEN: ${{ secrets.API_ACCESS_TOKEN }} | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm ci | |
- name: Test build | |
run: npm run build | |
Deploy: | |
needs: TestBuild | |
runs-on: ubuntu-latest | |
env: | |
PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.PUBLIC_SUPABASE_ANON_KEY }} | |
PUBLIC_SUPABASE_URL: ${{ secrets.PUBLIC_SUPABASE_URL }} | |
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }} | |
SERVICE_KEY: ${{ secrets.SERVICE_KEY }} | |
API_ACCESS_TOKEN: ${{ secrets.API_ACCESS_TOKEN }} | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: arn:aws:iam::104733724423:role/GitHub | |
role-duration-seconds: 1200 | |
aws-region: us-east-1 | |
- name: Deploy app | |
run: | | |
npm i && npx sst deploy --stage prod |