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: test, build and deploy site | |
on: [push] | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: run e2e tests | |
uses: cypress-io/github-action@v5 | |
with: | |
start: npm run ci:e2e | |
env: | |
CYPRESS_baseUrl: http://localhost:8080/ | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: ./cypress/videos/ | |
build: | |
needs: cypress-run | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
- name: build for static hosting | |
run: | | |
npm install | |
npm run docs:build | |
touch docs/.vitepress/dist/.nojekyll # https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/ | |
- name: deploy the site | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
build_dir: docs/.vitepress/dist/ | |
fqdn: ${{ secrets.SITE_FQDN }} | |
env: | |
GH_PAT: ${{ secrets.DEPLOYMENT_PAT }} |