-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.5 KB
/
black-and-white.js.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
name: Check Changed Files and Build Black and White PDFs
on:
push:
branches:
- main
jobs:
detect_changes_and_build_bw:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- name: Install dependencies
run: npm install
- name: Run JavaScript code to build black and white PDFs
run: |
npm run build-bw ${{ steps.changed-files.outputs.all_changed_files }}
- name: Commit and Push Changes to black-and-white branch
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git fetch origin black-and-white:black-and-white
git checkout black-and-white
git rebase origin/black-and-white
git add .
git commit -m "Automated build: update changed black and white PDFs"
git push origin black-and-white