Skip to content

Commit a57d4ff

Browse files
authored
Merge pull request #248 from ccamel/ci/capture-website
Ci/capture website
2 parents 24cd1cd + 0cb3b1a commit a57d4ff

File tree

3 files changed

+59
-7
lines changed

3 files changed

+59
-7
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Capture website
2+
3+
on:
4+
workflow_dispatch:
5+
6+
schedule:
7+
- cron: "0 0 1 * *"
8+
9+
concurrency:
10+
group: capture-website-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
capture-website:
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Check out repository
18+
uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.RELEASE_TOKEN }}
21+
22+
- name: Import GPG key
23+
uses: crazy-max/ghaction-import-gpg@v6
24+
with:
25+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
27+
git_config_global: true
28+
git_user_signingkey: true
29+
git_commit_gpgsign: true
30+
31+
- name: Setup node environment
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 18.17
35+
cache: npm
36+
37+
- name: Screenshot Website
38+
env:
39+
WEBSITE_URL: https://ccamel.github.io/playground-elm/
40+
run: |
41+
42+
--type=webp \
43+
--quality=0.7 \
44+
--launch-options='{"headless": "new"}' \
45+
--dark-mode \
46+
--output=screenshot.webp \
47+
--overwrite \
48+
$WEBSITE_URL
49+
50+
- name: Commit changes
51+
uses: stefanzweifel/git-auto-commit-action@v5
52+
with:
53+
commit_user_name: ${{ secrets.USER_NAME }}
54+
commit_user_email: ${{ secrets.USER_EMAIL }}
55+
commit_author: ${{ secrets.USER_NAME }} <${{ secrets.USER_EMAIL }}>
56+
commit_message: ":memo: Update website screenshot"

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ jobs:
4646
- name: Deploy project to github pages
4747
run: ./scripts/deploy-to-gh-pages.sh
4848
env:
49-
USER_EMAIL: ${{ secrets.USER_EMAIL }}
50-
USER_NAME: ${{ secrets.USER_NAME }}
49+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
50+
USER_NAME: ${{ secrets.USER_NAME }}
5151
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
The purpose of this playground is to explore, study and assess the [elm][] language — a delightful language for reliable
2020
webapps.
2121

22-
<p align="center">
23-
<a href="https://ccamel.github.io/playground-elm/">
24-
<img alt="demo-link" src="https://img.shields.io/badge/demo-https%3A%2F%2Fccamel.github.io%2Fplayground--elm%2F-blue?style=for-the-badge&logo=firefox">
25-
</a>
26-
</p>
22+
[![https://ccamel.github.io/playground-elm/](./screenshot.webp)](https://ccamel.github.io/playground-elm/)
2723

2824
The showcases are intended to be:
2925

0 commit comments

Comments
 (0)