build: make pilot an optional dependency. #2121
This file contains hidden or 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: Website | |
| on: | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - '.github/workflows/website.yml' | |
| - 'docs/**' | |
| - 'website/**' | |
| push: | |
| branches: [master] | |
| paths: | |
| - '.github/workflows/website.yml' | |
| - 'docs/**' | |
| - 'website/**' | |
| jobs: | |
| checks: | |
| if: github.event_name != 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: dorny/paths-filter@v2 | |
| id: changes | |
| with: | |
| filters: | | |
| website: | |
| - 'website/**' | |
| - name: Test Build | |
| working-directory: ./website | |
| run: | | |
| npm i | |
| npm run build | |
| - name: Run Percy Snapshot | |
| working-directory: ./website | |
| if: steps.changes.outputs.website == 'true' | |
| run: npm run percy | |
| env: | |
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
| gh-release: | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} | |
| - name: Release to GitHub Pages | |
| env: | |
| USE_SSH: true | |
| GIT_USER: git | |
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "mobilewix" | |
| cd website/ | |
| npm i | |
| npm run build | |
| npm run percy | |
| npx docusaurus deploy | |
| performance: | |
| needs: gh-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: mkdir -p ${{ github.workspace }}/tmp/artifacts | |
| - name: Lighthouse | |
| uses: foo-software/lighthouse-check-action@master | |
| with: | |
| urls: 'https://wix.github.io/Detox/,https://wix.github.io/Detox/docs/next/demo/' | |
| outputDirectory: ${{ github.workspace }}/tmp/artifacts | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Lighthouse reports | |
| path: ${{ github.workspace }}/tmp/artifacts |