-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/9_hotfix' into main
- Loading branch information
Showing
6 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build & Publish Dashboard-dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- hotfix/** # Matches any branch with prefix 'hotfix/' | ||
- release/** # Matches any branch with prefix 'release/' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: gtmnerr # CHANGE THIS TO BE A SECRET ON GITHUB ### | ||
password: dckr_pat__hEdxbRrtLePYXseurTdnZ7da6M # CHANGE THIS TO BE A SECRET ON GITHUB ### | ||
|
||
# Build and push the Docker image to dockerhub | ||
- name: Build and push docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./05_DASHBOARD/Dockerfile-dev | ||
push: true | ||
tags: gtmnerr/dashboard-dev:latest | ||
no-cache: true | ||
build-args: | | ||
BRANCH_NAME=${{ github.ref_name }} | ||
- name: List contents of the app directory | ||
run: docker run --rm gtmnerr/dashboard-dev:latest ls /usr/src/dashboard-development/ | ||
|
||
# run the docker image to publish to shinyapps.io | ||
- name: Run docker image | ||
# CHANGE ALL VARIABLES TO BE SECRETS ON GITHUB ### | ||
run: > | ||
docker run -e SHINY_ACC_NAME=gtmnerr -e TOKEN=C45D396CDEDC0F87E0415BDDCB10D264 -e SECRET=amOf/66XsI1PtjFXGhEmWaBcuIzlhY6WLBirWL2y gtmnerr/dashboard-dev:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
FROM rocker/shiny:4.3.2 | ||
# Define BRANCH_NAME as an argument | ||
ARG BRANCH_NAME | ||
# You can use the ARG value as an environment variable if needed | ||
ENV BRANCH_NAME=${BRANCH_NAME} | ||
RUN install2.r rsconnect shiny tidyverse bslib leaflet sf | ||
WORKDIR /usr/src/dashboard-development | ||
# Copy the 'app' directory contents into the container at /usr/src/app | ||
COPY ./ /usr/src/dashboard-development | ||
# Copy the 'app' directory contents into the container | ||
COPY ./03_Data_for_app /usr/src/dashboard-development/03_Data_for_app/ | ||
COPY ./04_Tests /usr/src/dashboard-development/04_Tests/ | ||
COPY ./05_DASHBOARD /usr/src/dashboard-development/05_DASHBOARD/ | ||
CMD Rscript /usr/src/dashboard-development/05_DASHBOARD/deploy.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM rocker/shiny:4.3.2 | ||
# Define BRANCH_NAME as an argument | ||
ARG BRANCH_NAME | ||
# You can use the ARG value as an environment variable if needed | ||
ENV BRANCH_NAME=${BRANCH_NAME} | ||
RUN install2.r rsconnect shiny tidyverse bslib leaflet sf | ||
WORKDIR /usr/src/dashboard-development | ||
# Copy the 'app' directory contents into the container | ||
COPY ./03_Data_for_app /usr/src/dashboard-development/03_Data_for_app/ | ||
COPY ./04_Tests /usr/src/dashboard-development/04_Tests/ | ||
COPY ./05_DASHBOARD /usr/src/dashboard-development/05_DASHBOARD/ | ||
CMD Rscript /usr/src/dashboard-development/05_DASHBOARD/deploy-dev.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Load the rsconnect package | ||
library(rsconnect) | ||
|
||
# Authenticate | ||
rsconnect::setAccountInfo( | ||
name = Sys.getenv("SHINY_ACC_NAME"), | ||
token = Sys.getenv("TOKEN"), | ||
secret = Sys.getenv("SECRET")) | ||
|
||
# Deploy | ||
rsconnect::deployApp( | ||
appDir = "./05_DASHBOARD", | ||
appFiles = "app.R", | ||
appName = "Dashboard-dev", | ||
forceUpdate = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters