webhook #1040
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: Run CD | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: | |
- webhook | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: | | |
npm config set registry https://registry.npmjs.org | |
npm install | |
- name: Run formatter and tests | |
run: | | |
npm run format_check | |
npm run lint | |
npm run test | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Build website | |
env: | |
PUBLIC_API_URL: https://cms.correlaid.org | |
PUBLIC_PRERENDER: ALL | |
PUBLIC_ADAPTER: STATIC | |
PUBLIC_PREVIEW: FALSE | |
PUBLIC_ON_CMS_ERROR: FAIL | |
DIRECTUS_TOKEN: ${{ secrets.DIRECTUS_TOKEN }} | |
BUILD_DIR: 'build/' | |
run: npm run build | |
- name: Run tests on static build | |
env: | |
PUBLIC_API_URL: https://cms.correlaid.org | |
PUBLIC_PRERENDER: ALL | |
PUBLIC_ADAPTER: STATIC | |
PUBLIC_PREVIEW: FALSE | |
PUBLIC_ON_CMS_ERROR: FAIL | |
BUILD_DIR: 'build/' | |
run: npm run e2e | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: Deploy to Vercel | |
uses: amondnet/vercel-action@v20 | |
with: | |
scope: ${{ secrets.ORG_ID }} | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
vercel-org-id: ${{ secrets.ORG_ID }} | |
vercel-project-id: ${{ secrets.PROJECT_ID }} | |
working-directory: ./ | |
vercel-args: '--prod --archive=split-tgz' |