Skip to content

fix warning

fix warning #6

Workflow file for this run

---
name: Pkgdown Docs πŸ“š
on:
push:
tags:
- "v*"
branches:
- main
- pre-release
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- pre-release
paths:
- inst/templates/**
- _pkgdown.yaml
- DESCRIPTION
- "**.md"
- "**.Rmd"
- man/**
- LICENSE.*
- NAMESPACE
workflow_dispatch:
workflow_call:
secrets:
GITHUB_TOKEN:

Check failure on line 32 in .github/workflows/pkgdown.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/pkgdown.yaml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
description: |
Github token with read access to repositories, required for staged.dependencies installation
required: false
inputs:
install-system-dependencies:
description: Check for and install system dependencies
required: false
default: false
type: boolean
fail-pkgdown-on-warnings:
description: Fail the pkgdown workflow if warnings are generated while generating docs
required: false
default: false
type: boolean
enable-staged-dependencies-check:
description: Enable staged dependencies YAML check
required: false
default: false
type: boolean
concurrency:
group: docs-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docs:
name: Generate 🐣
runs-on: ubuntu-latest
if: >
!contains(github.event.commits[0].message, '[skip docs]')
&& github.event.pull_request.draft == false
container:
image: ghcr.io/insightsengineering/rstudio_4.2.1_bioc_3.15:latest
steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v5
- name: Checkout repo πŸ›Ž
uses: actions/checkout@v3
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}
- name: Run Staged dependencies 🎦
uses: insightsengineering/staged-dependencies-action@v1
with:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SD_REPO_PATH: ${{ github.event.repository.name }}
SD_ENABLE_CHECK: ${{ inputs.enable-staged-dependencies-check }}
- name: Install R package 🚧
run: |
setwd("${{ github.event.repository.name }}")
if (file.exists("renv.lock")) renv::restore()
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}
- name: Build docs πŸ—
if: github.event_name != 'push'
run: |
repo="${{ github.event.repository.name }}"
cd $repo
Rscript - <<EOF 2>&1 | tee pkgdown_${repo}.log
if (file.exists("renv.lock")) renv::restore()
pkgdown::build_site(devel = TRUE)
EOF
if [ "${{ inputs.fail-pkgdown-on-warnings }}" == "true" ]; then {
grep "Warning message" pkgdown_${repo}.log > pkgdown_warnings_${repo}.log
if [[ $(wc -l <pkgdown_warnings_${repo}.log) -gt 0 ]]; then {
echo "----------------------------------------"
echo "⚠ One or more warnings were generated during the pkgdown build."
echo "Please πŸ™ fix the warnings shown above πŸ‘†"
exit 1
}
fi
}
fi
shell: bash
- name: Create documentation artifact πŸ“‚
if: github.event_name != 'push'
run: |
pushd ${{ github.event.repository.name }}/docs/
zip -r9 $OLDPWD/pkgdown.zip *
popd
shell: bash
- name: Upload docs for review ⬆
if: github.event_name != 'push'
uses: actions/upload-artifact@v3
with:
name: pkgdown.zip
path: pkgdown.zip
- name: Publish docs πŸ“’
if: github.event_name == 'push'
run: |
cd ${{ github.event.repository.name }}
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
BRANCH_OR_TAG="${GITHUB_REF##*/}"
Rscript - <<EOF
if (file.exists("renv.lock")) renv::restore()
pkgdown::deploy_to_branch(
new_process = FALSE,
subdir = "${BRANCH_OR_TAG}",
clean = TRUE
)
EOF
shell: bash
multi-version-docs:
name: Multi-version docs πŸ“‘
needs: docs
runs-on: ubuntu-latest
if: >
github.event_name == 'push'
&& !contains(github.event.commits[0].message, '[skip docs]')
steps:
- name: Checkout repo πŸ›Ž
uses: actions/checkout@v3
with:
path: ${{ github.event.repository.name }}
ref: "gh-pages"
- name: Create and publish docs ↗️
uses: insightsengineering/r-pkgdown-multiversion@v2
with:
path: ${{ github.event.repository.name }}
default-landing-page: "main"
upload-release-assets:
name: Upload documentation assets πŸ”Ό
needs: docs
runs-on: ubuntu-latest
if: >
startsWith(github.ref, 'refs/tags/v')
&& !contains(github.event.commits[0].message, '[skip docs]')
steps:
- name: Checkout repo πŸ›Ž
uses: actions/checkout@v3
- name: Download artifact ⏬
uses: actions/download-artifact@v3
with:
name: pkgdown.zip
- name: Upload binaries to release ‴
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkgdown.zip
asset_name: pkgdown.zip
tag: ${{ github.ref }}
overwrite: true