Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 snakemake
Copyright (c) 2019-2026 The Snakemake team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Preliminary commands to run before the workflow execution.

### `task`

Whether to run Snakemake or to generate a container image specification (in the form of a Dockerfile) that contains all required environments. Can be either `run` or `containerize`. Default `run`.
Whether to run Snakemake or to generate a container image specification (`Dockerfile`, `apptainer.def`) that contains all required environments. Can be either `run` or `containerize`. Default `run`.

### `show-disk-usage-on-error`

Expand All @@ -36,6 +36,14 @@ Snakemake version to install from conda. Default `*` (latest available version f

Optional Snakemake git branch to install from `https://github.com/snakemake/snakemake`. If set, this takes precedence over `snakemake-version` and Snakemake is installed from source via pip.

### `install-apptainer`

Whether to install Apptainer (true/false). Default `false`.

### `containerize-args`

Additional arguments for `containerize`, can be one of 'dockerfile', 'apptainer' or '' (defaults to dockerfile).

Comment thread
m-jahn marked this conversation as resolved.
## Example usage

```yaml
Expand Down Expand Up @@ -69,4 +77,5 @@ Optional Snakemake git branch to install from `https://github.com/snakemake/snak
directory: ".test"
snakefile: "workflow/Snakefile"
task: "containerize"
containerize-args: "apptainer"
```
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ inputs:
description: Install Apptainer (true/false)
required: false
default: "false"
containerize-args:
description: Additional arguments for --containerize, can be one of 'dockerfile', 'apptainer' or '' (defaults to dockerfile)
required: false
default: ""

runs:
using: "composite"
Expand Down Expand Up @@ -117,4 +121,10 @@ runs:
- name: Containerize snakemake
if: ${{ inputs.task == 'containerize' }}
shell: bash -el {0}
run: snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }} --containerize > Dockerfile
run: |
if [[ "${{ inputs.containerize-args }}" == "apptainer" ]]; then
recipe="apptainer.def"
else
recipe="Dockerfile"
fi
snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }} --containerize ${{ inputs.containerize-args }} > $recipe
Loading