fix R version #17
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: biocbook | |
on: | |
push: | |
branches: | |
- devel | |
- RELEASE_** | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
name: Build and push Docker [${{ github.ref_name }}] | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: π§Ύ Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: π Get book info | |
id: info | |
run: | | |
echo pkgversion=$(grep -m1 -E '^Version: +' DESCRIPTION | sed -E 's/.*: +//') >> "${GITHUB_ENV}" | |
- name: π Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: π· Get metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/${{ github.workflow }} | |
tags: | | |
type=raw,value=${{ env.pkgversion}},enable=true | |
type=raw,value=${{ github.ref_name }},enable=true | |
- name: π· Build and push multi-arch Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64 | |
file: Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
outputs: type=image,annotation-index.org.opencontainers.image.description=${{ github.workflow }} | |
build-args: | | |
BIOC_VERSION=${{ github.ref_name }} | |
render-deploy: | |
needs: build-push | |
runs-on: ubuntu-latest | |
name: Render and publish book [${{ github.ref_name }}] | |
container: ghcr.io/${{ github.repository_owner }}/${{ github.workflow }}:${{ github.ref_name }} | |
permissions: | |
contents: write | |
packages: read | |
steps: | |
- name: π§Ύ Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: π¦ List installed packages | |
run: | | |
pkgs <- installed.packages()[,"Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: π Install rsync | |
run: | | |
apt-get update && apt-get install -y rsync | |
- name: π§ Install quarto dependencies | |
run: | | |
quarto install tinytex | |
quarto check | |
# - name: π§ Install python dependencies | |
# uses: py-actions/py-dependency-install@v4 | |
# with: | |
# path: "inst/assets/requirements.txt" | |
- name: π Render book from versionized container | |
run: | | |
quarto render | |
- name: π· Get gh-branch directory to deploy to | |
run: | | |
echo folder=$(echo ${{ github.ref_name }} | sed 's,RELEASE_,,' | tr '_' '.') >> "${GITHUB_ENV}" | |
- name: π Deploy book to Github Pages on versionized branch | |
uses: JamesIves/github-pages-deploy-action@v4.4.3 | |
with: | |
folder: docs/ | |
target-folder: docs/${{ env.folder }}/ | |
branch: gh-pages | |
clean: false |