Skip to content

Commit

Permalink
SIMPLIFY
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Feb 22, 2024
1 parent 7dff43a commit 1110a9b
Show file tree
Hide file tree
Showing 47 changed files with 125 additions and 343 deletions.
90 changes: 0 additions & 90 deletions .github/workflows/docker-test.yml

This file was deleted.

110 changes: 110 additions & 0 deletions .github/workflows/refresh-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@

name: Refresh All
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

jobs:
refresh-all:
name: Refresh All
runs-on: ubuntu-latest
container:
image: cansav09/metricminer

yaml-check:
name: Load user automation choices
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

# Use the yaml-env-action action.
- name: Load environment from YAML
uses: doughepi/[email protected]
with:
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence.

outputs:
toggle_calendly: "${{ env.RENDER_CALENDLY }}"
toggle_ga: "${{ env.RENDER_GA }}"
toggle_github: "${{ env.RENDER_GITHUB }}"
toggle_googleforms: "${{ env.RENDER_GOOGLEFORMS }}"
toggle_slido: "${{ env.RENDER_SLIDO }}"
toggle_youtube: "${{ env.RENDER_YOUTUBE }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"

render-calendly:
name: Render Calendly
needs: yaml-check
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
if: ${{needs.yaml-check.outputs.toggle_calendly == 'yes'}}

steps:
- name: Refresh Google Analytics
env:
METRICMINER_CALENDLY: ${{ secrets.METRICMINER_CALENDLY }}
run: Rscript refresh-data/refresh-calendly.R

render-ga:
name: Render Google Analytics
needs: yaml-check
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
if: ${{needs.yaml-check.outputs.toggle_ga == 'yes'}}

steps:
- name: Refresh Google Analytics
env:
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }}
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }}
run: Rscript refresh-data/refresh-ga.R

render-github:
name: Render Github
needs: yaml-check
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
if: ${{needs.yaml-check.outputs.toggle_github == 'yes'}}

steps:
- name: Refresh Github
env:
METRICMINER_GITHUB_PAT: ${{ secrets.METRICMINER_GITHUB_PAT }}
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }}
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }}
run: Rscript refresh-data/refresh-github.R

refresh-googleforms:
name: Render Google Forms
needs: yaml-check
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
if: ${{needs.yaml-check.outputs.toggle_googleforms == 'yes'}}

steps:
- name: Refresh Google Forms
env:
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }}
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }}
run: Rscript refresh-data/refresh-googleforms.R

refresh-slido:
name: Render Slido
needs: yaml-check
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
if: ${{needs.yaml-check.outputs.toggle_slido == 'yes'}}

steps:
- name: Refresh Slido
env:
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }}
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }}
run: Rscript refresh-data/refresh-slido.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This code was adapted by Carrie Wright to enable automated rendering of the site associated with this repository

name: Render html
name: Refresh Site

# Controls when the action will run. Triggers the workflow on push
# events only for the master branch
Expand All @@ -12,6 +12,7 @@ on:
push:
branches: [ main ]
paths:
- data
- '**.Rmd'
- styles.css
- _site.yml
Expand Down Expand Up @@ -63,11 +64,6 @@ jobs:
id: site
run: Rscript -e "rmarkdown::render_site()"

# We may have html files that we want to render to add as links on the pages -these will be stored in a dir called subdir_html
- name: Render subdir_html
id: subdir_html
run: Rscript -e "for (i in list.files(path = './subdir_html', pattern = 'Rmd$', recursive = TRUE, full.names = TRUE)){rmarkdown::render(i)}"

# This checks on the steps before it and makes sure that they completed.
# If the renders didn't complete we don't want to commit the file changes
- name: Check on render steps
Expand Down
35 changes: 13 additions & 22 deletions _site.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
name: OTTR Template Website
name: metricminer dashboard
output_dir: '.'
navbar:
title: OTTR Web
title: metricminer dashboard
left:
- text: Home
href: index.html
icon: fa-home
- text: Setup
href: setup.html
- text: Hosting
href: hosting.html
- text: Editing
href: editing.html
- text: Style
href: style.html
- text: Git Actions
href: git_actions.html
- text: Docker
href: docker.html
- text: Contact
href: contact.html
icon: fa-envelope

- text: Calendly
href: calendly.html
- text: GitHub
href: github.html
- text: Google Analytics
href: googleanalytics.html
- text: Slido
href: slido.html
- text: Youtube
href: youtube.html

output:
html_document:
theme: cosmo
lib_dir: site_libs
self_contained: no
highlight: textmate
css: styles.css
includes:
in_header: resources/header.html
in_footer: resources/footer.html
Binary file modified resources/.DS_Store
Binary file not shown.
Binary file removed resources/images/actions.png
Binary file not shown.
Binary file removed resources/images/add_rule.png
Binary file not shown.
Binary file removed resources/images/blue.png
Binary file not shown.
Binary file removed resources/images/branch_rule.png
Binary file not shown.
Binary file removed resources/images/branches.png
Binary file not shown.
Binary file removed resources/images/checks.png
Binary file not shown.
Binary file removed resources/images/checks2.png
Binary file not shown.
Binary file removed resources/images/classic_tokens.png
Binary file not shown.
Binary file removed resources/images/create-repo.png
Binary file not shown.
Binary file removed resources/images/developer_settings.png
Binary file not shown.
Binary file removed resources/images/emoji.png
Binary file not shown.
Binary file removed resources/images/example_image.png
Binary file not shown.
Binary file removed resources/images/favicon.ico
Binary file not shown.
Binary file removed resources/images/general.png
Binary file not shown.
Binary file removed resources/images/generate_classic.png
Binary file not shown.
Binary file removed resources/images/gh_pat_set_up.png
Binary file not shown.
Binary file removed resources/images/icons.png
Binary file not shown.
Binary file removed resources/images/main_branch.png
Binary file not shown.
Binary file removed resources/images/more_icons.png
Binary file not shown.
Binary file removed resources/images/more_icons_result.png
Binary file not shown.
Binary file removed resources/images/navbar.png
Binary file not shown.
Binary file removed resources/images/page_modification.png
Binary file not shown.
Binary file removed resources/images/pages.png
Binary file not shown.
Binary file removed resources/images/render_error.png
Binary file not shown.
Binary file removed resources/images/render_fail.png
Binary file not shown.
Binary file removed resources/images/render_fail2.png
Binary file not shown.
Binary file removed resources/images/render_fail_details.png
Diff not rendered.
Binary file removed resources/images/repo_action_token.png
Diff not rendered.
Binary file removed resources/images/set_up_token.png
Diff not rendered.
Binary file removed resources/images/setting_gh_pat.png
Diff not rendered.
Binary file removed resources/images/settings.png
Diff not rendered.
Binary file removed resources/images/spelling.png
Diff not rendered.
Binary file removed resources/images/theme.png
Diff not rendered.
Binary file removed resources/images/title.png
Diff not rendered.
Binary file removed resources/images/url_check.png
Diff not rendered.
Binary file removed resources/images/urls.png
Diff not rendered.
Binary file removed resources/images/usersettings.png
Diff not rendered.
Binary file removed resources/images/website_setup.png
Diff not rendered.
Binary file removed resources/images/workflows.png
Diff not rendered.
File renamed without changes.
6 changes: 0 additions & 6 deletions subdir_html/subdir_file_example.Rmd

This file was deleted.

219 changes: 0 additions & 219 deletions subdir_html/subdir_file_example.html

This file was deleted.

0 comments on commit 1110a9b

Please sign in to comment.