build: Added GitHub actions to lint and run Jest tests #18
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: Deploy and Test | |
on: | |
push: | |
branches: [ develop, main, master ] | |
pull_request: | |
branches: [ develop, main, master ] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Deploy to Vercel | |
uses: amondnet/vercel-action@v25 | |
with: | |
git-message: ${{ github.event.head_commit.message }} | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
vercel-org-id: ${{ vars.VERCEL_ORG_ID }} | |
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID }} | |
test: | |
needs: deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
environment: preview | |
env: | |
BASE_URL: ${{ github.event.deployment_status.target_url }} | |
JWT_ADMIN_EMAIL: ${{ secrets.JWT_ADMIN_EMAIL }} | |
JWT_EMAIL: ${{ secrets.JWT_EMAIL }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
steps: | |
- name: Output environment variables | |
run: | | |
echo "CI is $CI" | |
echo "BASE_URL is $BASE_URL" | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install chromium --with-deps | |
- name: Run Playwright tests | |
run: npx playwright test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |