Skip to content

Commit be09080

Browse files
committed
Begin docker builds via GH actions workflow.
1 parent 4587433 commit be09080

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed

.github/workflows/build-image.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v1
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v1
18+
- name: Login to GitHub Container Registry
19+
uses: docker/login-action@v1
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.repository_owner }}
23+
password: ${{ secrets.CR_PAT }}
24+
- name: Build and push
25+
id: docker_build
26+
uses: docker/build-push-action@v2
27+
with:
28+
push: true
29+
tags: davidski/evaluator:latest
30+
build-args: |
31+
arg1=value1
32+
arg2=value2

.github/workflows/dependabot.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM rocker/tidyverse:4.0.3 as builder
2+
3+
ARG EVALUATOR_VERSION
4+
ENV BUILD_DATE=2020-11-27
5+
ARG ADD=shiny
6+
7+
LABEL org.opencontainers.licenses="MIT" \
8+
org.opencontainers.source="https://github.com/davidski/evaluator" \
9+
maintainer="David F. Severski <[email protected]>"
10+
11+
RUN /rocker_scripts/install_shiny_server.sh
12+
13+
COPY . /src/
14+
WORKDIR /src
15+
16+
RUN apt-get update \
17+
&& apt-get install -y zlib1g-dev libproj-dev libpng-dev libxml2-dev \
18+
&& install2.r --deps=TRUE remotes \
19+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
20+
21+
RUN apt-get clean \
22+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
23+
24+
COPY /scripts/create_templates.R /usr/local/bin/create_templates
25+
COPY /scripts/run_analysis.R /usr/local/bin/run_analysis
26+
27+
VOLUME /data
28+
29+
EXPOSE 8787
30+
EXPOSE 3838

scripts/create_templates.R

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/local/bin/r
2+
3+
## initialize templates
4+
5+
message("Creating templates...")
6+
library(evaluator)
7+
create_templates("/data")
8+
message("Templates created.")
9+

scripts/run_analysis.R

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/local/bin/r
2+
3+
## run analysis
4+
5+
message("Running analysis...")
6+
base_dir <- "/data"
7+
source("/data/run_analysis.R", echo=FALSE)

0 commit comments

Comments
 (0)