Add workflow for manifest.json #1
Workflow file for this run
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
# Workflow derived from https://solutions.posit.co/operations/deploy-methods/ci-cd/github-actions/#overview-of-deploying-to-connect | |
name: write-manifest | |
on: | |
push: | |
branches: [dev] | |
pull_request: | |
branches: [dev] | |
jobs: | |
write-manifest: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'renv' | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-renv@v2 | |
- name: install required packages | |
run: Rscript -e 'install.packages(c("rsconnect"))' | |
- name: Create manifest.json | |
shell: Rscript {0} | |
run: | | |
rsconnect::writeManifest() | |
- name: commit results | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git add manifest.json || echo "WARN: manifest.json was not updated" | |
git commit -m 'Re-build manifest file' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" |