-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.64 KB
/
deploy-app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
on:
push:
branches:
- main
- master
- dev
name: deploy-app
jobs:
deploy-app:
if: "contains(github.event.head_commit.message, 'deploy app')"
runs-on: macOS-latest
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.PRIVATE_ACTIONS_PAT }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@master
- name: Install dependencies
run: |
install.packages(c("remotes", "rsconnect"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Main run
if: github.ref == 'refs/heads/main'
run: |
rsconnect::setAccountInfo(name = '${{ github.repository_owner }}', token = '${{ secrets.SHINYAPPS_TOKEN }}', secret = '${{ secrets.SHINYAPPS_SECRET }}')
rsconnect::deployApp(appName = '${{ github.event.repository.name }}')
shell: Rscript {0}
- name: Dev run
if: github.ref == 'refs/heads/dev'
run: |
rsconnect::setAccountInfo(name = '${{ github.repository_owner }}', token = '${{ secrets.SHINYAPPS_TOKEN }}', secret = '${{ secrets.SHINYAPPS_SECRET }}')
rsconnect::deployApp(appName = paste0('${{ github.event.repository.name }}', '-dev'))
shell: Rscript {0}
- name: action-slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
uses: 8398a7/[email protected]
with:
status: ${{ job.status }}
author_name: "github action: ${{github.workflow}}"
fields: repo, ref, commit, author, message