Fix deploy workflow error #13
Workflow file for this run
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: Deployment (Dev) | |
on: | |
push: | |
branches-ignore: | |
- 'main' | |
concurrency: | |
group: merge-${{ github.ref }} | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
Test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: latest | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run tests | |
run: pnpm test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
Build: | |
needs: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: latest | |
- name: Install Node.js | |
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') }}- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
env: | |
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} | |
Deploy: | |
needs: Build | |
runs-on: ubuntu-latest | |
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 }} | |
steps: | |
- name: Git clone the repository | |
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') }}- | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ vars.ROLE_TO_ASSUME }} | |
aws-region: ap-southeast-1 | |
- name: Install SST CLI | |
run: | | |
curl -fsSL https://ion.sst.dev/install | bash | |
- name: Deploy app | |
run: | | |
pnpm install && sst deploy --stage dev |