Skip to content

Commit

Permalink
Trying to get github pages working
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-phelps authored Mar 18, 2024
1 parent 3e4118f commit 9c7247e
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
branches: [main, master, dev]
release:
types: [published]
workflow_dispatch:
Expand Down Expand Up @@ -39,7 +39,6 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

# If not pull request a brand new webpage is deployed
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
Expand All @@ -48,37 +47,3 @@ jobs:
branch: gh-pages
folder: docs

# If pull request the webpage is deployed inside a dev/"PR number" folder for review

- name: Add pkgdown PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
header: pkgdown
message: |
# Github pages
Review the pkgdown webpage for the PR [here](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/dev/${{ github.event.pull_request.number }})
- name: Copy page to temp folder
if: github.event_name == 'pull_request'
run: |
mkdir -p /home/runner/work/dev
cp -r ./docs/* /home/runner/work/dev
- name: Check out gh-pages branch
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Copy and push to gh-pages
if: github.event_name == 'pull_request'
run: |
mkdir -p dev/${{ github.event.pull_request.number }}
cp -r /home/runner/work/dev/* ./dev/${{ github.event.pull_request.number }}
git config --global user.email "actions-robot@novonordisk.com"
git config --global user.name "Actions Robot From Github Actions"
git add .
git commit -m "Update gh pages from the PR"
git push

0 comments on commit 9c7247e

Please sign in to comment.