-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.59 KB
/
build-web.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
name: Publicar a Github Pages
on:
push:
branches:
- 'main'
jobs:
check-files:
name: Check if .md have been updated
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.out.outputs.updated }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.1
- name: Set output
id: out
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file"
if [[ "$file" == *docs/chapters/*md*
|| "$file" == *docs/chapters/*.bib*
|| "$file" == *docs/Makefile*
|| "$file" == *docs/headers/*.md ]]; then
echo '::set-output name=updated::true'
fi
done
build-web:
name: Construir la web
needs: check-files
if: ${{ needs.check-files.outputs.updated }}
runs-on: ubuntu-latest
container: asmilex/raytracing
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Compile web documentation
run: |
cd docs
make PANDOC_EXEC=pandoc web
sed -i 's/<img/<img loading="lazy"/' index.html
- name: Commit and push index.html
run: |
git config --global --add safe.directory /__w/Raytracing/Raytracing
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "[:robot:] Actualizado github-pages"
git push