Render metrics-reports #109
This file contains hidden or 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: | |
| inputs: | |
| extend_im: | |
| description: 'Prospective institutional member' | |
| required: FALSE | |
| period_begin: | |
| description: 'Period beginning date (YYYY-MM-DD)' | |
| required: FALSE | |
| period_end: | |
| description: 'Period ending date (YYYY-MM-DD)' | |
| required: FALSE | |
| name: Render metrics-reports | |
| jobs: | |
| render: | |
| name: Render metrics-reports | |
| runs-on: ubuntu-latest | |
| env: | |
| EXTERNAL_GH_FOLDER: ${{ secrets.EXTERNAL_GH_FOLDER }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: r-lib/actions/setup-tinytex@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| - name: Install extra LaTeX packages | |
| run: sudo apt install texlive-latex-recommended | |
| - name: Clone private data repository | |
| env: | |
| EXTERNAL_GH_TOKEN: ${{ secrets.EXTERNAL_GH_TOKEN }} | |
| run: | | |
| git clone "https://oauth2:$EXTERNAL_GH_TOKEN@github.com/QualitativeDataRepository/$EXTERNAL_GH_FOLDER.git" | |
| - name: Render documents | |
| env: | |
| DATAVERSE_TOKEN: ${{ secrets.DATAVERSE_TOKEN }} | |
| extend_im: ${{ github.event.inputs.extend_im }} | |
| period_begin: ${{ github.event.inputs.period_begin }} | |
| period_end: ${{ github.event.inputs.period_end }} | |
| run: Rscript -e 'rmarkdown::render("metrics_report.Rmd", "all", output_dir=paste0(Sys.getenv("EXTERNAL_GH_FOLDER"), "/output"))' | |
| - name: Commit results | |
| run: | | |
| cd $EXTERNAL_GH_FOLDER | |
| git config --local user.email "actions@github.com" | |
| git config --local user.name "GitHub Actions" | |
| git add -A | |
| git commit -am "$(date)" | |
| git push |