CI #793
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 4 * * *" | |
| repository_dispatch: | |
| types: | |
| - rebuild | |
| workflow_dispatch: | |
| inputs: | |
| force_update: | |
| description: 'Force regenerate all screenshots (ignore freshness checks)' | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "npm" | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Upload images to CDN and generate JSON file | |
| run: | | |
| if [ "${{ github.event.inputs.force_update }}" = "true" ]; then | |
| npm run dev -- --force | |
| else | |
| npm run dev | |
| fi | |
| env: | |
| IMAGEKIT_PUBLIC_KEY: ${{ secrets.IMAGEKIT_PUBLIC_KEY }} | |
| IMAGEKIT_PRIVATE_KEY: ${{ secrets.IMAGEKIT_PRIVATE_KEY }} | |
| - name: Commit new screenshots | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| file_pattern: "screenshots screenshots.json" | |
| branch: ${{ github.head_ref }} | |
| commit_message: Commit new screenshots | |
| commit_user_name: Analysis Tools Bot | |
| commit_user_email: [email protected] | |
| commit_author: Analysis Tools Bot <[email protected]> | |
| - name: Redeploy website | |
| uses: peter-evans/repository-dispatch@v1 | |
| with: | |
| token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
| repository: analysis-tools-dev/website-next | |
| event-type: rebuild | |