Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace devtools with pak #251

Closed
wants to merge 21 commits into from
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ jobs:
QUARTO_PROFILE=development
concurrency-group: development
r-cmd-stable:
if: github.event_name != 'push'
# if: github.event_name != 'push'
name: R CMD Check (stable) 🧬
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@replace-devtools-with-pak
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
install-deps-from-package-repositories: "R-universe=https://insightsengineering.r-universe.dev/,CRAN=https://cloud.r-project.org/"
install-deps-from-package-repositories: "CRAN=https://cloud.r-project.org,R-universe=https://insightsengineering.r-universe.dev/bin/linux/noble/4.4"
package-subdirectory: package
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
QUARTO_PROFILE=stable
QUARTO_PROFILE=stable
concurrency-group: stable
linter:
if: github.event_name != 'push'
Expand Down
71 changes: 41 additions & 30 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
push:
branches:
- main
- replace-devtools-with-pak
schedule:
- cron: "17 17 * * 3,6"

Expand Down Expand Up @@ -50,7 +51,7 @@ jobs:
container:
image: ghcr.io/insightsengineering/rstudio:latest
needs: cache-refresh
if: ${{ always() }}
if: github.event_name != 'push'
permissions:
contents: write
steps:
Expand Down Expand Up @@ -135,14 +136,24 @@ jobs:
book/_freeze
key: ${{ runner.os }}-tlg-catalog-stable

- name: Cache packages 📀
uses: actions/cache@v4
with:
path: |
~/.cache/R/pkgcache/pkg
key: ${{ runner.os }}-pkgcache

- name: Normalize variables 📏
run: |
echo "gchat_webhook=${{ secrets.GCHAT_WEBHOOK }}" >> $GITHUB_ENV
shell: bash

- name: Install packages 🎦
run: |
devtools::install_dev_deps(".", repos = c("https://insightsengineering.r-universe.dev/", "https://cloud.r-project.org/"))
if (!require("pak")) install.packages("pak", upgrade = "never")
pak::repo_add("R-universe" = "https://insightsengineering.r-universe.dev/bin/linux/noble/4.4")
pak::repo_get()
pak::local_install_dev_deps(root = ".", upgrade = FALSE)
shell: Rscript {0}
working-directory: package

Expand All @@ -152,34 +163,34 @@ jobs:
shell: bash
working-directory: book

- name: Create artifact 📂
if: startsWith(github.ref, 'refs/tags/v')
run: |
zip -r9 ../../site.zip *
shell: bash
working-directory: book/_site

- name: Upload docs ⬆
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: site-stable
path: site.zip

- name: Publish docs 📔
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_site
destination_dir: stable

- name: GChat notification 🔔
if: (failure() || cancelled()) && env.gchat_webhook != ''
uses: insightsengineering/google-chat-notification@master
with:
name: ${{ github.event.repository.name }} - stable
url: ${{ secrets.GCHAT_WEBHOOK }}
status: ${{ job.status }}
# - name: Create artifact 📂
# if: startsWith(github.ref, 'refs/tags/v')
# run: |
# zip -r9 ../../site.zip *
# shell: bash
# working-directory: book/_site

# - name: Upload docs ⬆
# if: startsWith(github.ref, 'refs/tags/v')
# uses: actions/upload-artifact@v4
# with:
# name: site-stable
# path: site.zip

# - name: Publish docs 📔
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./book/_site
# destination_dir: stable

# - name: GChat notification 🔔
# if: (failure() || cancelled()) && env.gchat_webhook != ''
# uses: insightsengineering/google-chat-notification@master
# with:
# name: ${{ github.event.repository.name }} - stable
# url: ${{ secrets.GCHAT_WEBHOOK }}
# status: ${{ job.status }}

upload-release-assets:
name: Upload assets 🔼
Expand Down
Loading