Skip to content

Capture website

Capture website #14

name: Capture website
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
concurrency:
group: capture-website-${{ github.ref }}
cancel-in-progress: true
jobs:
capture-website:
runs-on: ubuntu-22.04
env:
SCREENSHOT_FILE: screenshot.webp
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.1.2
- name: Setup node environment
uses: actions/setup-node@v4
with:
node-version: 20.18
cache: "pnpm"
- name: Screenshot Website
env:
WEBSITE_URL: https://ccamel.github.io/playground-elm/
run: |
npx capture-website-cli@4.0.0 \
--type=webp \
--quality=0.7 \
--launch-options='{"headless": "new"}' \
--dark-mode \
--output=screenshot.webp \
--overwrite \
$WEBSITE_URL
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: ${{ env.SCREENSHOT_FILE }}
commit_user_name: ${{ secrets.USER_NAME }}
commit_user_email: ${{ secrets.USER_EMAIL }}
commit_author: ${{ secrets.USER_NAME }} <${{ secrets.USER_EMAIL }}>
commit_message: ":memo: Update website screenshot"