-
Notifications
You must be signed in to change notification settings - Fork 3
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 #34 from uptake/button_push_update
github action to update gallery documentation
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 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,54 @@ | ||
name: Gallery Update To Match Latest Version Tag | ||
|
||
# manual trigger for now | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-website: | ||
name: build gallery | ||
runs-on: macos-latest | ||
steps: | ||
- name: checkout gallery repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Get Latest Version From the Other Repository | ||
id: latesttag | ||
run: | | ||
latestVersion=$(git -c 'versionsort.suffix=-' \ | ||
ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/uptake/pkgnet 'v*.*.*' \ | ||
| tail --lines=1 \ | ||
| awk -F/ '{ print $3 }' \ | ||
| sed s/v//) | ||
echo "Found $latestVersion" | ||
- name: Update Version in local DESCRIPTION file | ||
run: sed -i -E "s/Version:.+$/Version:\s$latestVersion/" $GITHUB_WORKSPACE/DESCRIPTION | ||
- name: Git Checkout New Docs Branch | ||
run: | | ||
git checkout -b website_docs_update | ||
- name: set up R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: 'release' | ||
- uses: r-lib/actions/setup-pandoc@v2 | ||
- uses: r-lib/actions/setup-tinytex@v2 | ||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
packages: pkgdown | ||
- name: Build Gallery | ||
run: pkgnet_build_gallery.R | ||
shell: Rscript {0} | ||
- name: Save Site Docs Articfact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "built_gallery_docs_${{steps.latesttag.outputs.latestVersion}}" | ||
path: ${{github.workspace}}/docs/ | ||
- name: Commit website doc changes (overwrite if existing) | ||
run: | | ||
git add DESCRIPTION docs/\* | ||
git commit -m "Update gallery documentation to ${{steps.previoustag.outputs.tag}}" || echo "No changes to commit" | ||
git push -f origin website_docs_update |