Fix Makefile #142
This file contains hidden or 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
| name: Development build | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Dev build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: r-lib/actions/setup-r@v2 | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| dependencies: NA | |
| extra-packages: any::devtools | |
| - name: Build package | |
| run: | | |
| make documentation | |
| - name: Commit development build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name $GITHUB_ACTOR | |
| git config user.email $GITHUB_ACTOR@users.noreply.github.com | |
| git remote set-url --push origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git | |
| git checkout -b build | |
| git add --force NAMESPACE man | |
| git commit -m 'Create a development build' | |
| git push --force origin build | |
| docs: | |
| name: Publish documentation | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: build | |
| fetch-depth: 0 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y inkscape pngcrush | |
| - uses: r-lib/actions/setup-r@v2 | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| dependencies: NA | |
| extra-packages: any::pkgdown | |
| - name: Build documentation | |
| run: | | |
| if Rscript -e 'quit(status = if (pkgdown::as_pkgdown()$development$in_dev) 0 else 1)' >/dev/null 2>&1; then | |
| # Preserve release documentation website, if it exists. | |
| git cherry-pick origin/site || : | |
| fi | |
| make site | |
| - name: Publish documentation | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name $GITHUB_ACTOR | |
| git config user.email $GITHUB_ACTOR@users.noreply.github.com | |
| git remote set-url --push origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git | |
| git branch -D -r origin/site || : | |
| git checkout -b site | |
| git add --force docs | |
| if [ -d docs/dev ]; then | |
| dev='dev ' | |
| else | |
| dev='' | |
| fi | |
| git commit -m "Build ${dev}documentation" | |
| git push --force origin site |