Build and deploy #2314
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: Build and deploy | |
| permissions: | |
| actions: write | |
| attestations: none | |
| checks: write | |
| contents: write | |
| deployments: none | |
| id-token: write | |
| issues: none | |
| discussions: none | |
| packages: none | |
| pages: write | |
| pull-requests: none | |
| repository-projects: write | |
| security-events: none | |
| statuses: none | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '20 04 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | |
| with: | |
| cache: npm | |
| node-version-file: '.nvmrc' | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Run Puppeteer tests | |
| run: | | |
| ./run-tests.sh | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "username@users.noreply.github.com" | |
| git add data --all | |
| git commit -a -m "Test results obtained via GitHub Actions" | |
| git push | |
| - name: Build | |
| run: | | |
| npm install | |
| npm run build | |
| - name: Set up SSH | |
| uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Deploy | |
| uses: JamesIves/github-pages-deploy-action@22a6ee251d6f13c6ab1ecb200d974f1a6feb1b8d # v4.4.2 | |
| with: | |
| ssh-key: true | |
| single-commit: true | |
| branch: gh-pages | |
| folder: dist |