-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (44 loc) · 1.33 KB
/
main.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: main
on:
push:
schedule:
- cron: '0 0 * * *'
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Check out the main branch
uses: actions/checkout@v3
with:
ref: main
- name: Generate GitHub Pages
run: |
# Configure Git for the push from the workflow to the repository
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Run the script for refreshing the CSFD cinema data
npm install
npm start
# Stage the generated data
git add data
git add study.csv
# Run the CRA version build
rm -rf docs
cd cra
npm install
npm run build
cd ..
mv cra/build docs
# Stage the CRA build
git add docs
# Reset unstaged changes to prevent `git commit` from yelling if there's changes outside of `docs`
git checkout -- .
# Commit the changes to the Git repository to deploy GitHub Pages (if any)
if git diff-index --quiet HEAD --; then
exit
fi
git commit -m "Generate GitHub Pages"
# Pull before pushing to integrate fast forward changes if any
git pull --rebase
# Push the changes to GitHub
git push