-
Notifications
You must be signed in to change notification settings - Fork 898
44 lines (40 loc) · 1.4 KB
/
screenshot-new-site.yml
File metadata and controls
44 lines (40 loc) · 1.4 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
name: Capture screenshotties
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened]
paths:
- 'sites/*.md'
jobs:
screenshot:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Get changed markdown files
id: changed-files
uses: tj-actions/changed-files@v46
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