Skip to content

Commit

Permalink
Added a new pkgdown workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
telkamp7 committed Nov 8, 2023
1 parent a0ccc9e commit 939aefc
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,32 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branch: main
pull_request:
branches: [main, master]
branch: main
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: Deploy to GitHub Pages

jobs:
pkgdown:
cleanup:
name: 🧼 Clean up environment
if: ${{ (github.repository == 'ssi-dk/aeddo') && (github.event_name == 'release') }}
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: 🗑 Delete previous deployments
uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: github-pages
onlyRemoveDeployments: true

pkgdown-build:
name: Render pkgdown output
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
Expand All @@ -39,8 +54,27 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: pkgdown
path: docs/

deploy:
name: Deploy to GitHub pages 🚀
runs-on: ubuntu-latest
if: ${{ (github.repository == 'ssi-dk/aeddo') && (github.event_name == 'release') }}
needs: [cleanup, pkgdown-build]
steps:
- uses: actions/checkout@v3

- name: Download pkgdown output
uses: actions/download-artifact@v3
with:
name: pkgdown
path: docs

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
Expand Down

0 comments on commit 939aefc

Please sign in to comment.