forked from pharmaverse/pharmaverse
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.93 KB
/
pipeline.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
88
89
90
91
92
93
94
95
96
name: github pages
on:
push:
branches:
# - main # Set a branch to deploy
- develop # Note has logic around deployment
#schedule:
# - cron: 0 13 * * 1 # At 13:00 on Monday
jobs:
deploy:
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/[email protected]
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Install curl
run: sudo apt update && sudo apt-get install -y libcurl4-openssl-dev
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2.0'
- name: Setup renv
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 2
# - name: Run scripts
# run: |
# Rscript scripts/add_badges.R
# Rscript scripts/add_contributions.R
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Run visualisations
if: ${{ github.ref == 'refs/heads/main' }}
run: |
Rscript scripts/add_hexwall_network.R
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.85.0'
extended: true
# IF main
- name: Build
if: ${{ github.ref == 'refs/heads/main' }}
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# IF develop
- name: Build
if: ${{ github.ref == 'refs/heads/develop' }}
run: hugo -e staging
- name: Check
if: ${{ github.ref == 'refs/heads/develop' }}
run: ls -la /home/runner/work \ ls -la /home/runner/work/pharmaverse
#- name: Copy public to staging
# if: ${{ github.ref == 'refs/heads/develop' }}
# run: cp -R public home/runner/work/pharmaverse/pharmaverse/
#- name: Deploy to Posit Connect
# if: ${{ github.ref == 'refs/heads/develop' }}
# env:
# CONNECT_SERVER: ${{ secrets.POSIT_CONNECT_SERVER }}
# CONNECT_API_KEY: ${{ secrets.POSIT_CONNECT_API_KEY }}
# DEPLOYMENT_NAME: "pharmaverse-staging"
# run: |
# Rscript -e '
# print(list.files("public"));
# print(Sys.getenv("$CONNECT_SERVER"));
# rsconnect::addServer(url = Sys.getenv("CONNECT_SERVER"), name = Sys.getenv("DEPLOYMENT_NAME"));
# rsconnect::connectApiUser(apiKey = Sys.getenv("CONNECT_API_KEY"), server = Sys.getenv("DEPLOYMENT_NAME"));
# rsconnect::deployApp(
# appDir = "./public",
# appName = Sys.getenv("DEPLOYMENT_NAME"),
# server = Sys.getenv("DEPLOYMENT_NAME")
# );
# '