Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Jun 26, 2024
1 parent 3e6b9b6 commit 1bcdfc1
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 103 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ jobs:
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
# TODO r-universe to be removed
install-deps-from-package-repositories: "CRAN=https://cloud.r-project.org,R-universe=https://insightsengineering.r-universe.dev"
# install-deps-from-package-repositories: "CRAN=https://cloud.r-project.org"
package-subdirectory: package
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
Expand Down
202 changes: 101 additions & 101 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,75 +45,75 @@ jobs:
REPO: ${{ github.repository }}
BRANCH: ${{ github.event.repository.default_branch }}

# publish-dev:
# name: Build & Deploy TLGC (dev) 📖
# runs-on: ubuntu-latest
# container:
# image: ghcr.io/insightsengineering/rstudio:latest
# needs: cache-refresh
# if: ${{ always() }}
# permissions:
# contents: write
# steps:
# - name: Checkout repo 🛎
# uses: actions/[email protected]

# - name: Cache artifacts 📀
# uses: actions/cache@v4
# with:
# path: |
# ~/package/.staged.dependencies
# book/_freeze
# key: ${{ runner.os }}-tlg-catalog-dev
publish-dev:
name: Build & Deploy TLGC (dev) 📖
runs-on: ubuntu-latest
container:
image: ghcr.io/insightsengineering/rstudio:latest
needs: cache-refresh
if: github.event_name != 'push'
permissions:
contents: write
steps:
- name: Checkout repo 🛎
uses: actions/[email protected]

# - name: Normalize variables 📏
# run: |
# echo "gchat_webhook=${{ secrets.GCHAT_WEBHOOK }}" >> $GITHUB_ENV
# shell: bash
- name: Cache artifacts 📀
uses: actions/cache@v4
with:
path: |
~/package/.staged.dependencies
book/_freeze
key: ${{ runner.os }}-tlg-catalog-dev

# - name: Run Staged dependencies 🎦
# uses: insightsengineering/staged-dependencies-action@v1
# env:
# GITHUB_PAT: ${{ secrets.REPO_GITHUB_TOKEN }}
# with:
# path: "./package"
# enable-check: false
# direction: upstream
- name: Normalize variables 📏
run: |
echo "gchat_webhook=${{ secrets.GCHAT_WEBHOOK }}" >> $GITHUB_ENV
shell: bash

# - name: Render catalog 🖨
# run: |
# quarto render --profile development
# shell: bash
# working-directory: book
- name: Run Staged dependencies 🎦
uses: insightsengineering/staged-dependencies-action@v1
env:
GITHUB_PAT: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
path: "./package"
enable-check: false
direction: upstream

# - name: Create artifact 📂
# if: startsWith(github.ref, 'refs/tags/v')
# run: |
# zip -r9 ../../site.zip *
# shell: bash
# working-directory: book/_site
- name: Render catalog 🖨
run: |
quarto render --profile development
shell: bash
working-directory: book

# - name: Upload docs ⬆
# if: startsWith(github.ref, 'refs/tags/v')
# uses: actions/upload-artifact@v4
# with:
# name: site-development
# path: site.zip
- name: Create artifact 📂
if: startsWith(github.ref, 'refs/tags/v')
run: |
zip -r9 ../../site.zip *
shell: bash
working-directory: book/_site

# - name: Publish docs 📔
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./book/_site
# destination_dir: development
- name: Upload docs
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: site-development
path: site.zip

# - name: GChat notification 🔔
# if: (failure() || cancelled()) && env.gchat_webhook != ''
# uses: insightsengineering/google-chat-notification@master
# with:
# name: ${{ github.event.repository.name }} - development
# url: ${{ secrets.GCHAT_WEBHOOK }}
# status: ${{ job.status }}
- name: Publish docs 📔
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_site
destination_dir: development

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

publish-stable:
name: Build & Deploy TLGC (stable) 📖
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Install packages 🎦
run: |
if (!require("pak")) install.packages("pak", upgrade = "never")
pak::repo_add("R-universe" = "https://insightsengineering.r-universe.dev") # TODO to be removed
pak::repo_add("R-universe" = "https://insightsengineering.r-universe.dev")
pak::repo_get()
pak::local_install_dev_deps(root = ".", upgrade = FALSE)
shell: Rscript {0}
Expand Down Expand Up @@ -192,43 +192,43 @@ jobs:
# url: ${{ secrets.GCHAT_WEBHOOK }}
# status: ${{ job.status }}

# upload-release-assets:
# name: Upload assets 🔼
# needs: [publish-dev, publish-stable]
# 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/[email protected]

# - name: Download artifact ⏬
# uses: actions/download-artifact@v4
# with:
# name: site-development
# path: site-development
upload-release-assets:
name: Upload assets 🔼
needs: [publish-dev, publish-stable]
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/[email protected]

# - name: Download artifact ⏬
# uses: actions/download-artifact@v4
# with:
# name: site-stable
# path: site-stable
- name: Download artifact ⏬
uses: actions/download-artifact@v4
with:
name: site-development
path: site-development

# - name: Upload binaries to release ⤴
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: site-development/site.zip
# asset_name: catalog-development.zip
# tag: ${{ github.ref }}
# overwrite: true

# - name: Upload binaries to release ⤴
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: site-stable/site.zip
# asset_name: catalog-stable.zip
# tag: ${{ github.ref }}
# overwrite: true
- name: Download artifact ⏬
uses: actions/download-artifact@v4
with:
name: site-stable
path: site-stable

- name: Upload binaries to release ⤴
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: site-development/site.zip
asset_name: catalog-development.zip
tag: ${{ github.ref }}
overwrite: true

- name: Upload binaries to release ⤴
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: site-stable/site.zip
asset_name: catalog-stable.zip
tag: ${{ github.ref }}
overwrite: true

0 comments on commit 1bcdfc1

Please sign in to comment.