-
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (92 loc) · 3 KB
/
screenshots.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Makes screenshots of the project and publishes them as comment
name: Screenshots
on:
# Runs on pushes targeting the default branch
pull_request:
branches: ["main"]
# Default to bash
defaults:
run:
shell: bash
jobs:
# Check on PR
screenshots:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.108.0
permissions:
# Required to upload/save artifact, otherwise you'll get
# "Error: Resource not accessible by integration"
contents: write
# Required to post comment, otherwise you'll get
# "Error: Resource not accessible by integration"
pull-requests: write
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass Embedded
run: sudo snap install dart-sass-embedded
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
working-directory: ./src
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify
- name: Make screenshots
run: npm run screenshot
- name: Upload files as artifacts
id: upload-files-artifacts
uses: actions/upload-artifact@master
with:
name: Screenshots
path: |
src/public/index.html
./*.jpg
- name: Upload files to Imgbb
id: upload-files-imgbb
uses: McCzarny/upload-image@v1.0.0
with:
path: |
320x568.jpg
568x320.jpg
360x780.jpg
780x360.jpg
375x812.jpg
812x375.jpg
390x844.jpg
844x390.jpg
430x932.jpg
932x430.jpg
768x1024.jpg
1024x768.jpg
820x1180.jpg
1180x820.jpg
1280x720.jpg
1920x1080.jpg
uploadMethod: imgbb
apiKey: '${{ secrets.IMGBB_API_KEY }}'
- name: Publish the images
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
# Screenshots
## Smartphones
### iPhone 5
| Portrait Mode | Landscape Mode |
|----|----|
|  |  |
### Tablets
### Desktop
[Full ZIP](${{ steps.upload-files-artifacts.outputs.artifact-url }})