changed to csv #94
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: Render and Deploy All Quarto Documents | |
# on: | |
# push: | |
# branches: | |
# - main | |
# pull_request: | |
# branches: | |
# - main | |
jobs: | |
render: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Git user | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Create a test file | |
run: echo "This is a test file for debugging 12:24" > testfile.txt | |
- name: Add and commit the test file | |
run: | | |
git add testfile.txt | |
git commit -m 'Add test file for debugging' || echo "Nothing to commit" | |
- name: Push the test file to the main branch | |
run: | | |
git push https://x-access-token:${{ secrets.MY_GITHUB_PAT }}@github.com/tensorchiefs/data.git HEAD:main || echo "Nothing to push, already up-to-date" | |
- name: Fetch all branches | |
run: git fetch --all | |
- name: Check if docs branch exists | |
id: check_docs_branch | |
run: | | |
if git show-ref --verify --quiet refs/remotes/origin/docs; then | |
echo "branch_exists=true" >> $GITHUB_ENV | |
else | |
echo "branch_exists=false" >> $GITHUB_ENV | |
fi | |
- name: Create docs branch if it does not exist | |
if: env.branch_exists == 'false' | |
run: | | |
git checkout -b docs | |
git push https://x-access-token:${{ secrets.MY_GITHUB_PAT }}@github.com/tensorchiefs/data.git HEAD:docs | |
- name: Checkout docs branch if it exists | |
if: env.branch_exists == 'true' | |
run: | | |
git checkout docs | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Cache R packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.R | |
key: ${{ runner.os }}-R-${{ hashFiles('**/*.R') }} | |
restore-keys: | | |
${{ runner.os }}-R- | |
- name: Install specific R packages | |
run: | | |
Rscript -e 'install.packages(c("rmarkdown", "ggplot2", "remotes", "gitcreds"))' | |
- name: Install edudat package | |
run: | | |
Rscript -e 'remotes::install_github("tensorchiefs/data", subdir = "R/edudat", dependencies = TRUE, upgrade = "always", verbose = TRUE)' | |
- name: Render QMD files | |
run: | | |
quarto render data/*.qmd --to gfm | |
- name: Commit and push rendered files to docs branch | |
run: | | |
git add . | |
git commit -m 'Update rendered documentation' || echo "Nothing to commit" | |
git push https://x-access-token:${{ secrets.MY_GITHUB_PAT }}@github.com/tensorchiefs/data.git HEAD:docs || echo "Nothing to push, already up-to-date" |