Skip to content

Instantly share code, notes, and snippets.

View mwakok's full-sized avatar

Maurits Kok mwakok

View GitHub Profile
@mwakok
mwakok / conda_auto_env.sh
Last active July 1, 2023 13:31
Activate conda environment with cd in bash
#!/bin/bash
# Adapted from: https://janosh.dev/blog/conda-auto-env
#
# Automatically activates conda environments when entering directories
# containing a conda environment file. The file must be named
# - env(ironment).y(a)ml
# Deactivates env when exiting the directory. If the env doesn't exist yet,
# offer to create it from file. The script will use mamba if available.
#
# Setup:
@mwakok
mwakok / publish_jupyterbook.yml
Created December 17, 2021 16:39
Workflow to publish a jupyterbook
name: deploy-book
# Only run this when the master branch
on:
push:
branches:
- main
# Option to runa ction manually
workflow_dispatch:
inputs:
@mwakok
mwakok / python_package.yml
Last active January 12, 2022 20:12
Workflow to test and build a python package
name: Build and test Python package
on:
push:
pull_request:
types: [opened, reopened]
jobs:
python_tests:
name: first code check / python-3.8 / ubuntu-latest
@mwakok
mwakok / publish_pypi.yml
Created December 2, 2021 15:30
Workflow to publish on PyPI
name: Publish PyPI
on:
release:
types: [published]
jobs:
pypi:
runs-on: ubuntu-latest
steps:
@mwakok
mwakok / publish_dockerhub.yml
Created December 2, 2021 15:18
Workflow to publish on DockerHub
name: Publish DockerHub
on:
release:
types: [published]
jobs:
docker:
runs-on: ubuntu-latest
steps: