From 6b7a129f6127d0afaff6a8d214917f846cf599bc Mon Sep 17 00:00:00 2001 From: Eric Nantz Date: Sun, 17 Mar 2024 21:16:15 +0000 Subject: [PATCH] add gh action for publishing dashboard --- .github/workflows/publish.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4043502 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,62 @@ +on: + push: + branches: [main] + schedule: + - cron: "5 9 * * 0" + workflow_dispatch: + +name: Quarto Publish + +jobs: + build-deploy: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install jq for parsing system dependencies + id: install-jq-step + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: jq + version: 1.0 + + - name: Install system dependencies + id: install-deps-step + uses: awalsh128/cache-apt-pkgs-action@latest + env: + DEPS_ENV: ${{ steps.parse-dep-step.DEPS_ENV }} + with: + packages: libarchive-dev libcurl4-openssl-dev libssl-dev make + + - name: Setup r2u + id: r2u-step + uses: eddelbuettel/github-actions/r2u-setup@master + + - name: SessionInfo + id: sessioninfo-step + run: R -q -e 'sessionInfo()' + + - name: Install deps R package + id: r-pkg-deps-step + run: Rscript -e 'install.packages("deps")' + + - name: Package Dependencies + id: r-package-dependencies-step + # takes advantage of r2u to install the named CRAN packages as binaries + # in the r2u context we could also use script 'install.r' + #run: Rscript -e 'install.packages(c("tinyspotifyr", "ggplot2", "anytime", "data.table", "tinythemes"))' + run: Rscript -e 'deps::install()' + + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + + - name: Render and Publish + uses: quarto-dev/quarto-actions/publish@v2 + with: + target: gh-pages + path: quarto_dashboard + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file