forked from xdesro/personalsit.es
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.5 KB
/
screenshot-new-site.yml
File metadata and controls
48 lines (42 loc) · 1.5 KB
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
name: Capture screenshotties
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened]
paths:
- 'sites/*.md'
jobs:
screenshot:
runs-on: ubuntu-latest
steps:
- name: Checkout base repo
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Fetch PR commit history
run: git fetch origin pull/${{ github.event.pull_request.number }}/head:pr_head
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install dependencies
run: npm install
- name: Securely overlay untrusted PR markdown files
run: git checkout pr_head -- sites/
- name: Get changed markdown files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: |
sites/*.md
- name: Capture screenshots
if: steps.changed-files.outputs.any_changed == 'true'
env:
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
S3_USER_ACCESS_KEY: ${{ secrets.S3_USER_ACCESS_KEY }}
S3_USER_ACCESS_KEY_SECRET: ${{ secrets.S3_USER_ACCESS_KEY_SECRET }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_REGION: ${{ secrets.S3_REGION }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: node screenshot-new-site.js