refactor(replay): use lazy state initializer in Timeline #24
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| stage: | |
| description: SST stage to deploy | |
| required: true | |
| default: dev | |
| type: choice | |
| options: | |
| - dev | |
| - staging | |
| - production | |
| permissions: | |
| id-token: write | |
| contents: read | |
| concurrency: | |
| group: deploy-${{ inputs.stage || 'production' }} | |
| cancel-in-progress: false | |
| env: | |
| SST_STAGE: ${{ inputs.stage || 'production' }} | |
| jobs: | |
| migrate: | |
| name: Run Database Migrations | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| environment: ${{ inputs.stage || 'production' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - name: Run database migrations | |
| run: bun run db:migrate:run | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| deploy: | |
| name: Deploy SST (${{ inputs.stage || 'production' }}) | |
| needs: [migrate] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| environment: ${{ inputs.stage || 'production' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| aws-region: us-east-1 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - name: Deploy with SST | |
| run: bunx sst deploy --stage $SST_STAGE |