Get meetup data #637
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Get meetup data | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 */12 * * *" | |
jobs: | |
meetup: | |
name: Update meetup data | |
runs-on: macOS-latest | |
env: | |
MEETUPR_PWD: ${{ secrets.MEETUPR_PWD }} | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Cache packages | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.RENV_PATHS_ROOT }} | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- name: Restore packages | |
shell: Rscript {0} | |
run: | | |
if (!requireNamespace("renv", quietly = TRUE)) | |
install.packages("renv") | |
renv::restore() | |
- name: Meetup authentication | |
run: Rscript scripts/meetup_auth.R | |
- name: Update chapter data | |
run: Rscript scripts/get_chapters.R | |
- name: Update event data | |
run: Rscript scripts/get_events.R | |
- name: Commit data | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add data/ | |
git commit -m 'Update meetup data' || echo "No meetup data to commit" | |
git push || echo "Nothing to push" |