Skip to content

Commit 64e2962

Browse files
committed
Add deployment action
1 parent e6ed926 commit 64e2962

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
on:
2+
push:
3+
branches: [main, master]
4+
release:
5+
types: [published]
6+
workflow_dispatch: {}
7+
8+
name: demo-r-shinylive-app
9+
10+
jobs:
11+
demo-website:
12+
runs-on: ubuntu-latest
13+
# Only restrict concurrency for non-PR jobs
14+
concurrency:
15+
group: r-shinylive-website-${{ github.event_name != 'pull_request' || github.run_id }}
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
steps:
21+
- name: "Check out repository"
22+
uses: actions/checkout@v4
23+
24+
- name: "Setup R"
25+
uses: r-lib/actions/setup-r@v2
26+
27+
# Pinned shinylive dependency
28+
- name: "Setup R dependency for Shinylive App export"
29+
uses: r-lib/actions/setup-r-dependencies@v2
30+
with:
31+
packages:
32+
cran::shinylive@0.1.1
33+
34+
# Export the current working directory as the shiny app
35+
- name: Create Shinylive App from working directory files
36+
shell: Rscript {0}
37+
run: |
38+
shinylive::export(".", "_site")
39+
40+
# Upload a tar file that will work with GitHub Pages
41+
# Make sure to set a retention day to avoid running into a cap
42+
# This artifact shouldn't be required after deployment onto pages was a success.
43+
- name: Upload Pages artifact
44+
uses: actions/upload-pages-artifact@v2
45+
with:
46+
retention-days: 1
47+
48+
# Use an Action deploy to push the artifact onto GitHub Pages
49+
# This requires the `Action` tab being structured to allow for deployment
50+
# instead of using `docs/` or the `gh-pages` branch of the repository
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)