This repository was archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (87 loc) · 3.32 KB
/
main.yaml
File metadata and controls
88 lines (87 loc) · 3.32 KB
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
on: push
jobs:
CICD:
runs-on: ubuntu-20.04
defaults:
run:
shell: Rscript {0}
container:
# update muggle here and in Dockerfile
image: subugoe/muggle-buildtime-onbuild:9ee02c2d9b32cab07681288de9995dc3d4124e4d
env:
MUGGLE_PKG_NAME: ${{ github.event.repository.name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Cache R Packages
uses: actions/cache@v2
with:
# only cache the user library
path: ".github/library"
key: ${{ job.container.image }}-${{ hashFiles('DESCRIPTION') }}
- name: Install System Dependencies
run: muggle::install_sysdeps()
- name: Install R Dependencies
env:
# see builder.Dockerfile for explanation, this resets after this step
R_LIBS_SITE: $R_LIBS_RUNTIME_GH
run: remotes::install_deps(dependencies = TRUE)
- name: Check
# TODO error out on all but note again https://github.com/subugoe/hoad/issues/194
run: devtools::check(error_on = "error")
- name: Test Coverage
run: covr::codecov()
- name: Build Package Website
run: |
# extra step is necessary to build index.md to integrate readme and landing page
rmarkdown::render("pkgdown/index.Rmd")
pkgdown::build_site(override = list(new_process = FALSE))
- name: Build Buildtime Image
uses: docker/build-push-action@v1
with:
repository: ${{ github.repository }}/${{ env.MUGGLE_PKG_NAME }}-buildtime
target: buildtime
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
# this will set "latest" if master as per https://github.com/docker/build-push-action
tag_with_ref: true
# we're relying on long shas only to keep things easy
tag_with_sha: false
tags: ${{ github.sha }}
add_git_labels: true
push: ${{ github.event_name != 'pull_request' }}
- name: Build Runtime Image
uses: docker/build-push-action@v1
with:
repository: ${{ github.repository }}/${{ env.MUGGLE_PKG_NAME }}-runtime
target: runtime
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
# this will set "latest" if master as per https://github.com/docker/build-push-action
tag_with_ref: true
# we're relying on long shas only to keep things easy
tag_with_sha: false
tags: ${{ github.sha }}
add_git_labels: true
push: ${{ github.event_name != 'pull_request' }}
- name: Log in to Azure
uses: azure/login@v1.1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy to Azure Webapps
run: |
muggle::az_webapp_config_muggle(
plan = "hoad",
resource_group = "hoad",
subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc",
restart = TRUE
)
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: maxheld83/ghpages@github-token
env:
BUILD_DIR: docs
- name: Sleep to let GITHUB_TOKEN persist
run: Sys.sleep(240)