Skip to content

main

main #917

Workflow file for this run

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