Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Push Website Build from Last Version Tag #327

Merged
merged 6 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ on:
workflow_dispatch:

jobs:
version_check:
name: Confirm Whole Version Number
runs-on: macos-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: Grep Version in DESCRIPTION
shell: bash
run: grep -E "Version:\s\d+\.\d+\.\d+$" $GITHUB_WORKSPACE/DESCRIPTION
build-website:
name: build website PR
needs: [version_check]
name: build website docs on website_docs_update branch
runs-on: macos-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0 # pull all tags and other history
- name: Get Latest Version Tag
id: previoustag
uses: WyriHaximus/[email protected]
with:
prefix: 'v'
- name: Git Checkout Branch From Latest Version Tag
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git checkout -b website_docs_update ${{steps.previoustag.outputs.tag}}
- name: set up R
uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -38,11 +38,13 @@ jobs:
- name: Build Site
run: pkgdown::build_site()
shell: Rscript {0}
- name: Commit website doc changes
- name: Save Site Docs Articfact
uses: actions/upload-artifact@v4
with:
name: "built_website_docs_${{steps.previoustag.outputs.tag}}"
path: ${{github.workspace}}/docs/
- name: Commit website doc changes (overwrite if existing)
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add docs/\*
git commit -m "Update website documentation" || echo "No changes to commit"
git pull --ff-only
git push origin
git commit -m "Update website documentation to ${{steps.previoustag.outputs.tag}}" || echo "No changes to commit"
git push -f origin website_docs_update
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Add some notes explaining what has changed since the previous release (usually a

### Update the Website

Adding the new version tag in the previous step should have triggered a Github Action to build the website docs and create a PR. If not, manually trigger the workflow and create a PR to update the docs. Merge that in!
Adding the new version tag in the previous step should have triggered a Github Action to build the website docs and create a branch named `website_docs_update`. Review and merge.
bburns632 marked this conversation as resolved.
Show resolved Hide resolved

### Open a new PR to begin development on the next version

Expand Down