Get meetup data #1453
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 * * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
meetup: | |
name: Update meetup data | |
runs-on: ubuntu-latest | |
env: | |
MEETUPR_PWD: ${{ secrets.MEETUPR_PWD }} | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install cURL Headers | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev libsodium-dev | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: '4.2.0' | |
- 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 | |
if: github.event_name == 'schedule' || github.event_name == 'push' | |
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" |