Skip to content

Commit

Permalink
Merge pull request #266 from NBISweden/specky
Browse files Browse the repository at this point in the history
Move workshop to GitHub Pages
  • Loading branch information
fasterius authored Oct 24, 2024
2 parents b940ec3 + 3933524 commit 85a2d06
Show file tree
Hide file tree
Showing 162 changed files with 19,080 additions and 39,561 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-and-deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and deploy site

on:
workflow_dispatch:
push:
branches:
- main
- specky
paths-ignore:
- "README.md"
- "LICENCE.md"
- "env/"
- "pages/tools-for-reproducible-research.md"
- "tutorials/"

concurrency:
group: pages
cancel-in-progress: true

jobs:

build:
runs-on: ubuntu-latest
container: ghcr.io/nbisweden/workshop-reproducible-research/build-website:specky
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Build website with Quarto
uses: quarto-dev/quarto-actions/render@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/'

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
80 changes: 80 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and publish Docker images

on:
push:
branches:
- main
- devel
- specky
paths:
- "env/*/Dockerfile"
- "env/*/environment.yml"

env:
REGISTRY: ghcr.io
INCLUDE_DIR: "env/"
REPOSITORY: ${{ github.repository }}

jobs:
changed-directories:
name: Get last directory name of changed files
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
uses: tj-actions/changed-files@v45
id: changed-files
with:
matrix: true
dir_names: true
path: ${{ env.INCLUDE_DIR }}
dir_names_include_files: ${{ env.INCLUDE_DIR }}
dir_names_exclude_current_dir: true

build-and-push-image:
name: Build and push Docker images
runs-on: ubuntu-latest
needs: changed-directories
strategy:
fail-fast: false
matrix:
name: ${{ fromJSON(needs.changed-directories.outputs.matrix) }}
platform: [linux/amd64]
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ matrix.name }}
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
flavor: |
latest=false
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ env.INCLUDE_DIR }}/${{ matrix.name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platform }}
33 changes: 16 additions & 17 deletions .github/workflows/canvas-upload.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: canvas-upload
name: Canvas upload

on:
workflow_dispatch:
branches:
- main
- devel
push:
paths:
- 'pages/*.md'
- 'pages/*/*.md'
- 'pages/upload-page-to-canvas.sh'
branches:
- main
- devel
paths:
- 'pages/tools-for-reproducible-research.md'
- 'pages/upload-page-to-canvas.sh'

jobs:
upload:
runs-on: ubuntu-latest
container: pandoc/latex
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Upload pages
env:
API_TOKEN: ${{ secrets.CANVAS_API_TOKEN }}
run: |
docker pull pandoc/latex
for FILE in $(find pages -name '*.md' ! -name "README.md");
do
bash pages/upload-page-to-canvas.sh "$FILE" "$API_TOKEN"
done
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Upload landing page to Canvas
env:
API_TOKEN: ${{ secrets.CANVAS_API_TOKEN }}
run: |
bash pages/upload-page-to-canvas.sh pages/tools-for-reproducible-research.md $API_TOKEN
14 changes: 8 additions & 6 deletions .github/workflows/docker-run.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: docker
name: MRSA container testing

on:
workflow_dispatch:
branches:
- main
- devel
pull_request:
branches:
- main
paths:
- 'tutorials/containers/Dockerfile'
- 'tutorials/containers/environment.yml'
- 'tutorials/containers/Snakefile'
- 'tutorials/containers/config.yml'
- 'tutorials/containers/code/*'
branches:
- main

jobs:
docker-build-and-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker build
- name: Checkout
uses: actions/checkout@v4

- name: Build and test Docker image
run: |
docker build -t my_docker_project -f tutorials/containers/Dockerfile tutorials/containers/
docker run --rm my_docker_project
docker run --rm my_docker_project
44 changes: 0 additions & 44 deletions .github/workflows/docker-slim.yml

This file was deleted.

42 changes: 33 additions & 9 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: setup
name: Conda environment testing

on:
workflow_dispatch:
Expand All @@ -8,13 +8,30 @@ on:
pull_request:
branches:
- main
- devel
paths:
- 'tutorials/snakemake/snakefile_mrsa.smk'
- 'tutorials/snakemake/environment.yml'
- 'tutorials/nextflow/environment.yml'
- 'tutorials/nextflow/main_mrsa.yml'
- 'tutorials/nextflow/samplesheet.csv'
- 'tutorials/jupyter/environment.yml'
- 'tutorials/jupyter/references.bib'
- 'tutorials/jupyter/supplementary_material.ipynb'
- 'tutorials/quarto/environment.yml'
- 'tutorials/quarto/quarto-tutorial-example.qmd'

concurrency:
group: conda-env-test
cancel-in-progress: true

jobs:
install:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest ]
os: [macos-latest, ubuntu-latest]
env: [snakemake, nextflow, jupyter, quarto]
include:
- env: snakemake
Expand All @@ -24,18 +41,25 @@ jobs:
- env: jupyter
cmd: jupyter nbconvert --to HTML tutorials/jupyter/supplementary_material.ipynb
- env: quarto
cmd: mamba install -c conda-forge quarto && mamba install -c conda-forge deno && export QUARTO_DENO=$(which deno) && quarto render tutorials/quarto/quarto-tutorial-example.qmd --to html
cmd: conda install -c conda-forge quarto && conda install -c conda-forge deno && export QUARTO_DENO=$(which deno) && quarto render tutorials/quarto/quarto-tutorial-example.qmd --to html
exclude:
- os: macos-latest
env: snakemake
- os: macos-latest
env: nextflow
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/[email protected]
- name: Checkout
uses: actions/checkout@v4

- name: Conda setup
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: ${{ matrix.env }}-env
environment-file: tutorials/${{ matrix.env }}/environment.yml
use-mamba: true
channel-priority: strict
- name: Test ${{ matrix.env }}

- name: Test ${{ matrix.env }} Conda environment
shell: bash -l {0}
run: |
conda list
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ snakemake/*tsv
# Quarto-related files
.quarto/
**/*_files
_freeze/
docs/

# VScode
.vscode

/.quarto/
22 changes: 22 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
pagetitle: "404: Page not found"
subtitle: ""
date: ""
toc: false
sidebar: false
number-sections: false
format: html
execute:
freeze: false
---

::: {style="text-align: center;"}

[404]{.fourofour}

# 404: Page not found

It seems like you have stumbled upon a page that doesn't exist.
Please check your URL again.

:::
Loading

0 comments on commit 85a2d06

Please sign in to comment.