update action versions #338
This file contains 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: Website and Docker | |
on: [push, workflow_dispatch] | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
job1: | |
runs-on: ubuntu-24.04 | |
container: rocker/verse:latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
# System dependencies | |
- name: Install apt dependencies | |
run: | | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install rsync libv8-dev #for deploy and dagitty | |
curl -fsSL https://get.docker.com -o install-docker.sh | |
sh install-docker.sh | |
# Git submodule init fails with unsafe repository | |
- name: Add exception for /home/rstudio | |
run: git config --global --add safe.directory /home/rstudio | |
# Workaround: https://github.com/docker/build-push-action/issues/461 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Cache R packages | |
uses: actions/cache@v4 | |
with: | |
path: ${{ runner.tool_cache }}/R | |
key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION') }} | |
restore-keys: | | |
${{ runner.os }}-r- | |
- name: Install dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Check | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
args: "--no-manual" | |
- name: Render README | |
run: Rscript -e 'rmarkdown::render("README.Rmd", output_file = "README.md")' | |
- name: Build pkgdown site | |
run: Rscript -e 'pkgdown::build_site()' | |
- name: Update README.md | |
uses: github-actions-x/commit@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
push-branch: 'main' | |
commit-message: 'Update README.md' | |
force-add: 'true' | |
files: README.md session* | |
name: Levi's GitHub Robot | |
email: lwaldron.research@gmail.com | |
- name: Deploy ð | |
uses: JamesIves/github-pages-deploy-action@v4.6.3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs # The folder the action should deploy. | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest | |
github-token: ${{ secrets.GITHUB_TOKEN}} | |