-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.63 KB
/
attachements.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
name: Generate attachments
on:
pull_request:
branches: [ "main" ]
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
permissions:
#Required to upload/save artifact
contents: write
#Required to post comment
pull-requests: write
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.108.0
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@v3
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 screenshot
run: npm run screenshot
- name: Validate screenshot
run: npm run screenshot:test
- name: Upload files
uses: gavv/[email protected]
with:
commit: ${{ github.event.pull_request.head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifacts-branch: artifacts
artifacts: |
src/public/index.html
screenshot.png