Capture website #2
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: Capture website | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: capture-website-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| capture-website: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| token: ${{ secrets.OPS_TOKEN }} | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }} | |
| git_config_global: true | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 24 | |
| - name: Install capture tool | |
| run: npm install --global capture-website-cli@4.0.0 | |
| - name: Capture website | |
| run: | | |
| # --no-sandbox is required because Ubuntu 24.04+ runners disable unprivileged | |
| # user namespaces via AppArmor, making the Chromium sandbox unavailable in CI. | |
| capture-website \ | |
| --type webp \ | |
| --quality=0.7 \ | |
| --width=1440 \ | |
| --full-page \ | |
| --delay=15 \ | |
| --timeout=120 \ | |
| --throw-on-http-error \ | |
| --launch-options='{"headless":"new","args":["--no-sandbox"]}' \ | |
| --output surface.webp \ | |
| --overwrite \ | |
| https://surface.xyz/ | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_user_name: ${{ vars.BOT_GIT_COMMITTER_NAME }} | |
| commit_user_email: ${{ vars.BOT_GIT_COMMITTER_EMAIL }} | |
| commit_author: ${{ vars.BOT_GIT_AUTHOR_NAME }} <${{ vars.BOT_GIT_AUTHOR_EMAIL }}> | |
| commit_message: 'docs: update website screenshot' |