webhook #938
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: | |
# Allows external webhook trigger | |
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: 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 | |
DIRECTUS_TOKEN: ${{ secrets.DIRECTUS_TOKEN }} | |
run: npm run build-and-test | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: Deploy production on Vercel | |
env: # Set the secret as an input | |
WEBHOOK: ${{ secrets.VERCEL_WEBHOOK }} | |
run: | | |
curl -X POST "$WEBHOOK" |