-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from NIEHS/staging-internal
July version updates
- Loading branch information
Showing
162 changed files
with
4,305 additions
and
13,019 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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
# --- | ||
# name: Deploy Toolkit | ||
|
||
# on: | ||
# push: | ||
# branches: [main, master] | ||
# pull_request: | ||
# branches: [main, master] | ||
# release: | ||
# types: [published] | ||
# workflow_dispatch: | ||
|
||
# jobs: | ||
# deploy_toolkit: | ||
# runs-on: ubuntu-latest | ||
|
||
# # Only restrict concurrency for non-PR jobs | ||
# concurrency: | ||
# group: bookdown-${{ github.event_name != 'pull_request' || github.run_id }} | ||
|
||
# env: | ||
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# permissions: | ||
# contents: write | ||
|
||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
# - uses: r-lib/actions/setup-r@v2 | ||
# with: | ||
# use-public-rspm: true | ||
|
||
# - name: Install libudunits2 and libmagick | ||
# run: | | ||
# sudo apt-get install -y libudunits2-dev libgdal-dev | ||
# sudo apt-get install libmagick++-dev | ||
|
||
# - name: Build site | ||
# run: | | ||
# install.packages(c( | ||
# "bookdown", | ||
# "rmarkdown", | ||
# "plotly", | ||
# "shiny", | ||
# "tidycensus", | ||
# "tidyverse", | ||
# "viridis", | ||
# "ggmap", | ||
# "ggplot2", | ||
# "maps", | ||
# "dplyr", | ||
# "knitr", | ||
# "latticeExtra", | ||
# "pals", | ||
# "classInt", | ||
# "sf", | ||
# "udunits2", | ||
# "tmap", | ||
# "lubridate", | ||
# "gifski", | ||
# "magick", | ||
# "cowplot", | ||
# "BiocManager" | ||
# ), | ||
# dependencies = TRUE | ||
# ) | ||
# BiocManager::install("Biobase") | ||
# bookdown::render_book() | ||
# shell: Rscript {0} | ||
|
||
# - name: Deploy to GitHub pages 🚀 | ||
# if: github.event_name != 'pull_request' | ||
# uses: JamesIves/[email protected] | ||
# with: | ||
# clean: false | ||
# branch: gh-pages | ||
# folder: docs |
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,34 @@ | ||
--- | ||
name: Protect Branch `main` | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
protect_main: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check base branch | ||
id: check-base-branch | ||
run: | | ||
if [[ "${{ github.event.pull_request.base.ref }}" == "main" || "${{ github.event.pull_request.base.ref }}" == "master" ]]; then | ||
echo "Protected branch \"main\" detected in pull request." | ||
echo "continue=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "Protected branch \"main\" not detected in pull request." | ||
echo "continue=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Check source branch | ||
run: | | ||
continue="${{ steps.check-base-branch.outputs.continue }}" | ||
if [[ "$continue" == "true" ]]; then | ||
source_branch=$(jq -r '.pull_request.head.ref' "$GITHUB_EVENT_PATH") | ||
if [[ "$source_branch" != "staging-public" ]]; then | ||
echo "Pull requests into \"main\" must come from \"staging-public\"." | ||
exit 1 | ||
fi | ||
else | ||
echo "Protected branch \"main\" not detected in pull request." | ||
fi |
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,34 @@ | ||
--- | ||
name: Protect Branch `staging-public` | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
protect_staging_public: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check base branch | ||
id: check-base-branch | ||
run: | | ||
if [[ "${{ github.event.pull_request.base.ref }}" == "staging-public" ]]; then | ||
echo "Protected branch \"staging-public\" detected in pull request." | ||
echo "continue=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "Protected branch \"staging-public\" not detected in pull request." | ||
echo "continue=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Check source branch | ||
run: | | ||
continue="${{ steps.check-base-branch.outputs.continue }}" | ||
if [[ "$continue" == "true" ]]; then | ||
source_branch=$(jq -r '.pull_request.head.ref' "$GITHUB_EVENT_PATH") | ||
if [[ "$source_branch" != "staging-internal" ]]; then | ||
echo "Pull requests into \"staging-public\" must come from \"staging-internal\"." | ||
exit 1 | ||
fi | ||
else | ||
echo "Protected branch \"staging-public\" not detected in pull request." | ||
fi |
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,49 @@ | ||
# workflow to update external repository hosting staging webpage | ||
--- | ||
name: Update external repository `PCOR_bookdown_staging` | ||
|
||
on: | ||
push: | ||
branches: [staging-internal] | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout `PCOR_public` repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: staging-internal | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Clone the staging repository | ||
run: | | ||
cd ../ | ||
git clone https://${{ secrets.PCOR_bookdown_staging_actions_06262024 }}@github.com/NIEHS/PCOR_bookdown_staging.git | ||
cd PCOR_bookdown_staging | ||
git checkout main | ||
cd ../ | ||
- name: Check directory debug | ||
run: | | ||
cd ../ | ||
pwd | ||
ls -l | ||
- name: Sync files | ||
run: | | ||
cd ../ | ||
rsync -av --checksum --ignore-missing-args --exclude='.git' --exclude='.github' --exclude='.gitignore' --exclude='README.md' --delete ./PCOR_bookdown_tools/ ./PCOR_bookdown_staging/ || true | ||
cd PCOR_bookdown_staging | ||
git add . | ||
git status | ||
git commit -m "Sync PCOR_public staging-internal branch" || echo "No changes to commit" | ||
git push https://${{ secrets.PCOR_bookdown_staging_actions_06262024 }}@github.com/NIEHS/PCOR_bookdown_staging.git main | ||
env: | ||
GITHUB_PAT: ${{ secrets.PCOR_bookdown_staging_actions_06262024 }} |
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,22 @@ | ||
# --- | ||
# name: Update Branch `staging-internal` | ||
|
||
# on: | ||
# push: | ||
# branches: [staging-public] | ||
|
||
# jobs: | ||
# update_staging_internal: | ||
# runs-on: ubuntu-latest | ||
|
||
# if: github.event_name == 'push' && contains(github.event.head_commit.message, 'Merge pull request') | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Delete old branch | ||
# run: | | ||
# git push origin --delete staging-internal || true | ||
# git checkout -b staging-internal | ||
# git push origin staging-internal |
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,22 @@ | ||
# --- | ||
# name: Update Branch `staging-public` | ||
|
||
# on: | ||
# push: | ||
# branches: [main, master] | ||
|
||
# jobs: | ||
# update_staging_public: | ||
# runs-on: ubuntu-latest | ||
|
||
# if: github.event_name == 'push' && contains(github.event.head_commit.message, 'Merge pull request') | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Delete old branch | ||
# run: | | ||
# git push origin --delete staging-public || true | ||
# git checkout -b staging-public | ||
# git push origin staging-public |
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ _book/ | |
_bookdown_files/ | ||
_main_files | ||
.DS_Store | ||
docs/ |
Oops, something went wrong.