change walkability_indicator to walkability_index_raw #45
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: build_vdh_dashboard | |
on: | |
# schedule: | |
# - cron: '0 21 * * 2,5' # Run on Tuesday and Friday 9pm UTC (5pm EST) | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Cacnel previous runs if a new push is sent | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
generate-dashboard: | |
# Don't run if a pull request but not closed | |
if: github.event_name == 'schedule' || ((github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == 'true') || github.event_name == 'push') | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
pages: write | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
steps: | |
# Downloading both the repositories to simulate the original task | |
- uses: actions/checkout@main | |
with: | |
path: 'parent/${{ github.event.repository.name }}' | |
- uses: actions/checkout@main | |
with: | |
repository: uva-bi-sdad/social_data_commons | |
path: 'parent/social_data_commons' | |
- name: Run tree | |
run: | | |
tree .. | |
- name: Cache packages | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.RENV_PATHS_ROOT }} | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- uses: r-lib/actions/setup-r@v2 | |
- name: Cache downloaded repositories | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/parent/social_data_commons/repos | |
key: ${{ runner.os }}-repos | |
restore-keys: | | |
${{ runner.os }}-repos | |
- run: echo "💡 The ${{ github.repository }} repository have been cloned to the runner." | |
- name: Set up "data commons" | |
working-directory: ${{ github.workspace }}/parent/social_data_commons | |
shell: Rscript {0} | |
run: | | |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") | |
renv::init() | |
renv::restore() | |
install.packages('remotes') | |
remotes::install_github('uva-bi-sdad/community') | |
source("build.R") | |
datacommons_view( | |
"../social_data_commons", "${{ github.event.repository.name }}", | |
metadata = entities, entity_info = NULL | |
) | |
renv::snapshot() | |
- name: build ${{ github.event.repository.name }} | |
working-directory: ${{ github.workspace }}/parent/${{ github.event.repository.name }} | |
shell: Rscript {0} | |
run: | | |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") | |
renv::init() | |
renv::restore() | |
install.packages('remotes') | |
remotes::install_github('uva-bi-sdad/community') | |
source("build.R") | |
renv::snapshot() | |
- name: List files | |
run: | | |
ls -la | |
- name: Commit files # Commit changes. You need to do this so child sites work... | |
working-directory: parent/${{ github.event.repository.name }} | |
run: | | |
ls -la | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add -A | |
git commit -m "generating dashboard" | |
git push | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
# Upload entire repository | |
path: 'parent/${{ github.event.repository.name }}/docs' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |