Merge pull request #18 from cesardeazevedo/v0.0.7-content-links #57
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: CI Checks | |
on: | |
pull_request: | |
branches: [main, dev, prod] | |
push: | |
branches: [dev, prod] | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
if: ${{ !github.event.pull_request.draft }} | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright Browsers | |
run: pnpm playwright install --with-deps | |
- name: Run tests | |
run: pnpm test | |
- name: Run linter | |
run: pnpm run lint | |
- name: TypeScript type-check | |
run: pnpm run type-check | |
- name: Run Playwright tests | |
run: pnpm run test:e2e | |
deploy: | |
needs: checks | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/prod' || github.ref == 'refs/heads/dev') | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Deploy (development) | |
uses: jakejarvis/s3-sync-action@master | |
if: github.ref == 'refs/heads/dev' | |
with: | |
args: --follow-symlinks | |
env: | |
AWS_S3_BUCKET: ${{ secrets.DEV_AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} | |
SOURCE_DIR: 'dist' | |
- name: Deploy (production) | |
uses: jakejarvis/s3-sync-action@master | |
if: github.ref == 'refs/heads/prod' | |
with: | |
args: --follow-symlinks | |
env: | |
AWS_S3_BUCKET: ${{ secrets.PROD_AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} | |
SOURCE_DIR: 'dist' |