docs: Update README.md #10
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: Deploy KMA Score API - Prod environment | |
env: | |
DB_URL: ${{ secrets.DB_URL }} | |
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }} | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v2 | |
- name: Setup AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-southeast-1 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Lint | |
run: pnpm lint && pnpm typecheck | |
# https://stackoverflow.com/questions/68119012/create-env-file-in-gh-action-using-repo-secrets | |
- name: Apply all pending migrations to the database | |
run: | | |
echo $DB_URL > .env | |
pnpm db:migrate | |
working-directory: packages/core | |
- name: Deploy | |
run: pnpm sst deploy --stage prod | |