Capture website #34
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: Capture website | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" | |
concurrency: | |
group: capture-website-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
capture-website: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.OKP4_TOKEN }} | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.OKP4_BOT_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.OKP4_BOT_GPG_PASSPHRASE }} | |
git_config_global: true | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Setup node environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.12 | |
# don't use cache as it may interfere with other jobs | |
# cache: npm | |
- name: Install global dependencies | |
run: | | |
npm install --global capture-website-cli@4.0.0 | |
- name: Screenshot Website | |
run: | | |
capture-website \ | |
--type webp \ | |
--quality=0.7 \ | |
--launch-options='{"headless": "new"}' \ | |
--output screenshot.webp \ | |
--overwrite \ | |
--dark-mode \ | |
https://docs.okp4.network/ | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: ${{ secrets.OKP4_BOT_GIT_COMMITTER_NAME }} | |
commit_user_email: ${{ secrets.OKP4_BOT_GIT_COMMITTER_EMAIL }} | |
commit_author: ${{ secrets.OKP4_BOT_GIT_AUTHOR_NAME }} <${{ secrets.OKP4_BOT_GIT_AUTHOR_EMAIL }}> | |
commit_message: "docs: update website screenshot" |