Skip to content

Add CRAN submission info #49

Add CRAN submission info

Add CRAN submission info #49

name: Build pkgdown site
permissions: read-all
on:
workflow_dispatch:
inputs:
trigger_next:
description: 'Whether to run the subsequent workflows after triggering this one manually.'
required: false
default: false
push:
branches: main
jobs:
pkgdown:
runs-on: macOS-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SALESFORCER_USERNAME: ${{ secrets.SALESFORCER_USERNAME }}
SALESFORCER_TOKEN_PATH: ${{ github.workspace }}/tests/testthat/
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Decrypt OAuth Token
run: |
./.github/scripts/decrypt_secret.sh
env:
SALESFORCER_TOKEN_PASSPHRASE: ${{ secrets.SALESFORCER_TOKEN_PASSPHRASE }}
- name: Reveal env vars
run: |
echo GITHUB_WORKFLOW = $GITHUB_WORKFLOW
echo HOME = $HOME
echo GITHUB_ACTION = $GITHUB_ACTION
echo GITHUB_ACTIONS = $GITHUB_ACTIONS
echo GITHUB_ACTOR = $GITHUB_ACTOR
echo GITHUB_REPOSITORY = $GITHUB_REPOSITORY
echo GITHUB_EVENT_NAME = $GITHUB_EVENT_NAME
echo GITHUB_EVENT_PATH = $GITHUB_EVENT_PATH
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_SHA = $GITHUB_SHA
echo GITHUB_REF = $GITHUB_REF
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
- name: Trigger next workflow
if: ${{ (github.event_name != 'workflow_dispatch' && success()) || (github.event_name == 'workflow_dispatch' && github.event.inputs.trigger_next && success()) }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
event-type: main-02-test-coverage
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
- name: Set final R-CMD-check status
if: ${{ (github.event_name != 'workflow_dispatch' && failure()) }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
event-type: main-06-R-CMD-check-final
client-payload: '{"success": false}'