mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Build tool docker images: first attempt
This commit is contained in:
parent
5fbde1c69d
commit
b3cc751e78
1 changed files with 41 additions and 0 deletions
41
.github/workflows/docker.yml
vendored
Normal file
41
.github/workflows/docker.yml
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
name: Build Docker Images
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# Only on pushes to master (after PRs are merged)
|
||||||
|
branches: master
|
||||||
|
# Only if a conda environment file or a docker build file has been updated
|
||||||
|
paths:
|
||||||
|
- tools/*/environment.yml
|
||||||
|
- tools/*/Dockerfile
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# Check out the repo
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
# Find the tool wrappers that changed
|
||||||
|
# Annoyingly, matrix can't take dynamic variables
|
||||||
|
- name: Find changed tools
|
||||||
|
run: TOOLS=$( git diff --name-only $GITHUB_SHA | egrep -o 'tools\/[^\/]+\/' | sort | uniq | awk NF )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build images
|
||||||
|
run: |
|
||||||
|
for d in tools/*; do
|
||||||
|
for TOOL in $TOOLS; do
|
||||||
|
$TOOL
|
||||||
|
if echo $d/ | grep -q "$TOOL"; then
|
||||||
|
cd "$GITHUB_WORKSPACE/$d"
|
||||||
|
TOOLNAME=$(basename `pwd`)
|
||||||
|
IMGNAME=docker.pkg.github.com/${GITHUB_REPOSITORY,,}/${TOOLNAME,,}:$GITHUB_SHA
|
||||||
|
echo $IMGNAME
|
||||||
|
docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} docker.pkg.github.com
|
||||||
|
docker build -t $IMGNAME .
|
||||||
|
docker push $IMGNAME
|
||||||
|
fi;
|
||||||
|
done;
|
||||||
|
done;
|
Loading…
Reference in a new issue