Generate map data #9
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
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '23 2 * * 2' | |
name: 'Generate map data' | |
jobs: | |
fetch-data: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: | | |
local::. | |
epiverse-connect/epiverse-scraper | |
jsonlite | |
- name: Update data | |
env: | |
EMBEDDINGS_LOCATION: ${{ secrets.EMBEDDINGS_LOCATION }} | |
run: | | |
source("data-raw/json_map.R") | |
shell: Rscript {0} | |
- name: Commit latest data | |
run: | | |
git config user.email "action@github.com" | |
git config user.name "GitHub Actions" | |
git add inst/extdata/map_data.json | |
git commit -m "Fetch map data" | |
git pull --rebase origin main | |
git push | |
echo "pushed to github" | |
trigger-deploy: | |
needs: fetch-data | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.EPIVERSE_CONNECT_PAT }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Trigger re-deploy of the front-end | |
run: | | |
gh workflow run auto-deploy-pages.yml --repo epiverse-connect/epiverse-search-frontend |