From 35bba8f4704887f8818298dc832bd0ea8844e481 Mon Sep 17 00:00:00 2001 From: davidrsch Date: Fri, 8 Nov 2024 19:26:25 +0100 Subject: [PATCH] Adding workflow to deploy to gh-pages --- .github/workflows/deploy-app.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/deploy-app.yml diff --git a/.github/workflows/deploy-app.yml b/.github/workflows/deploy-app.yml new file mode 100644 index 0000000..4e27336 --- /dev/null +++ b/.github/workflows/deploy-app.yml @@ -0,0 +1,41 @@ +name: Deploy Shiny App to GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12.6" + + - name: Install dependencies + run: | + python -m venv pyenv + source pyenv/bin/activate + pip install -r requirements.txt + + - name: Build static Shiny app + run: | + source pyenv/bin/activate + shiny static-assets remove + shinylive export app docs + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + publish_branch: gh-pages + allow_empty_commit: true \ No newline at end of file