-
-
Notifications
You must be signed in to change notification settings - Fork 69
87 lines (87 loc) · 3.03 KB
/
check-and-deploy.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
on:
release:
types: [released]
pull_request:
types: [opened, synchronize, reopened]
issue_comment:
types: [created]
push:
branches:
- main
- master
name: Check & Deploy
jobs:
R-CMD-Check:
if: (github.event_name != 'issue_comment')
uses: prisma-flowdiagram/r-workflows/.github/workflows/R-CMD-check.yml@v1
pkgdown:
needs: R-CMD-check
if: (github.event_name == 'push')
uses: prisma-flowdiagram/r-workflows/.github/workflows/pkgdown.yml@v1
deploy-latest:
needs: pkgdown
if: (github.event_name == 'push')
uses: prisma-flowdiagram/r-workflows/.github/workflows/deploy.yml@v1
with:
install-package: true
rsconnect-account-name: "estech"
rsconnect-app-name: "PRISMA_flowdiagram_latest"
working-directory: "./inst/shiny-examples/PRISMA_flowdiagram"
environment: "latest"
renvironment-contents: |
PRISMA_ANALYTICS=TRUE
KOFI_DONATE=TRUE
secrets:
rsconnect-account-token: ${{ secrets.TOKEN }}
rsconnect-account-secret: ${{ secrets.SECRET }}
check-pr-deploy:
runs-on: ubuntu-latest
if: github.event_name == 'issue_comment'
outputs:
triggered: ${{ steps.check-pr.outputs.triggered }}
steps:
- uses: khan/pull-request-comment-trigger@v1.1.0
id: check-pr
with:
trigger: '!deploy'
reaction: rocket
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
get-pull-ref:
runs-on: ubuntu-latest
needs: check-pr-deploy
if: (github.event_name == 'issue_comment' && github.event.issue.pull_request)
outputs:
repository: ${{ fromJson(steps.get-repo.outputs.data).head.repo.full_name }}
ref: ${{ fromJson(steps.get-repo.outputs.data).head.ref }}
steps:
- name: get-pull-request-ref
id: get-repo
uses: octokit/request-action@v2.x
with:
route: GET /repos/:repository/pulls/:issue_id
repository: ${{ github.repository }}
issue_id: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
R-CMD-check-PR:
needs: [check-pr-deploy,get-pull-ref]
if: needs.check-pr-deploy.outputs.triggered == 'true'
uses: prisma-flowdiagram/r-workflows/.github/workflows/R-CMD-check.yml@v1
with:
repository: ${{ needs.get-pull-ref.outputs.repository || github.repository }}
ref: ${{ needs.get-pull-ref.outputs.ref || github.ref }}
deploy-pr-comment:
needs: [get-pull-ref,R-CMD-check-PR]
uses: prisma-flowdiagram/r-workflows/.github/workflows/deploy.yml@v1
with:
repository: ${{ needs.get-pull-ref.outputs.repository || github.repository }}
ref: ${{ needs.get-pull-ref.outputs.ref || github.ref }}
install-package: true
rsconnect-account-name: "prismaflow-test"
rsconnect-app-name: "PRISMA_flowdiagram"
working-directory: "./inst/shiny-examples/PRISMA_flowdiagram"
environment: "pr"
secrets:
rsconnect-account-token: ${{ secrets.TOKEN }}
rsconnect-account-secret: ${{ secrets.SECRET }}