Skip to content

Commit

Permalink
Merge pull request #111 from sgcarstrends/70-prepare-sst-deployment-w…
Browse files Browse the repository at this point in the history
…orkflow-for-production

Add GitHub Action workflow for prod deployment
  • Loading branch information
ruchernchong authored Aug 24, 2024
2 parents 6323833 + aa7479f commit 77f35e7
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/sst.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deployment (Production)
on:
push:
branches:
- 'release/*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

concurrency:
group: merge-${{ github.ref }}

permissions:
id-token: write
contents: read

jobs:
Deploy:
runs-on: ubuntu-latest
environment: Production
env:
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_FEATURE_FLAG_UNRELEASED: ${{ vars.NEXT_PUBLIC_FEATURE_FLAG_UNRELEASED }}
NEXT_PUBLIC_GA_MEASUREMENT_ID: ${{ vars.NEXT_PUBLIC_GA_MEASUREMENT_ID }}
NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_REVALIDATE_TOKEN: ${{ secrets.NEXT_PUBLIC_REVALIDATE_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
SG_CARS_TRENDS_API_TOKEN: ${{ secrets.SG_CARS_TRENDS_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ROLE_TO_ASSUME }}
aws-region: ap-southeast-1
- name: Deploy app
run: |
pnpm install && pnpm sst deploy --stage prod

0 comments on commit 77f35e7

Please sign in to comment.