Skip to content

Commit

Permalink
Merge branch 'hotfix/2_hotfix' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherMarais committed Feb 6, 2024
2 parents f5d5907 + 322b6a8 commit 38bfdea
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 38 deletions.
44 changes: 14 additions & 30 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Docker Image
name: Build Docker Image & Publish Dashboard

on:
push:
Expand All @@ -18,39 +18,23 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

# Uncoimment this to also push to dockerhub
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./05_DASHBOARD/Dockerfile
# push: true
# tags: your_dockerhub_username/your_repository:${{ github.ref_name }}-${{ steps.date.outputs.date }}-${{ github.sha }}
# # This tag includes the branch name, the current date, and the commit SHA
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: gtmnerr
password: dckr_pat__hEdxbRrtLePYXseurTdnZ7da6M # CHANGE THIS TO BE A SECRET ON GITHUB ###

- name: Build Docker image
# 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
push: false
# Removed the tags parameter since we're not pushing the image
push: true
tags: gtmnerr/dashboard:latest

# run the docker image supply the secrets from the github secrets store.
- name: execute
# 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=christophermarais \
-e TOKEN=908D29B518B4A47C935C6E63B03D4C73 \
-e SECRET=cH2hwZOTvRMKm5ouNDaX6zJrDo0WVVVsvOTzKRqu \
main
docker run -e SHINY_ACC_NAME=gtmnerr -e TOKEN=C45D396CDEDC0F87E0415BDDCB10D264 -e SECRET=amOf/66XsI1PtjFXGhEmWaBcuIzlhY6WLBirWL2y gtmnerr/dashboard:latest
19 changes: 11 additions & 8 deletions 05_DASHBOARD/deploy.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Authenticate
# setAccountInfo(name = Sys.getenv("SHINY_ACC_NAME"),
# token = Sys.getenv("TOKEN"),
# secret = Sys.getenv("SECRET"))
# Load the rsconnect package
library(rsconnect)

setAccountInfo(name = Sys.getenv("christophermarais"),
token = Sys.getenv("908D29B518B4A47C935C6E63B03D4C73"),
secret = Sys.getenv("cH2hwZOTvRMKm5ouNDaX6zJrDo0WVVVsvOTzKRqu"))
# Authenticate
rsconnect::setAccountInfo(
name = Sys.getenv("SHINY_ACC_NAME"),
token = Sys.getenv("TOKEN"),
secret = Sys.getenv("SECRET"))

# Deploy
deployApp(appFiles = c("app.R", "likes.rds"))
rsconnect::deployApp(
appDir = "./05_DASHBOARD",
appFiles = "app.R",
appName = "Dashboard")

0 comments on commit 38bfdea

Please sign in to comment.