diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 3a3313a..49ebb9a 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -7,24 +7,51 @@ on: - 'docker' jobs: - docker: + generate-matrix: runs-on: ubuntu-latest + outputs: + matrix-metadata: ${{ steps.metadata.outputs.matrix }} steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 + - uses: hellofresh/action-changed-files@v3 + id: metadata + with: + pattern: docker/(?P\w+)/.* + default-patterns: | + meta.yml + Dockerfile + + update-docker: + needs: [generate-matrix] + strategy: + matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-metadata) }} + if: ${{ fromJson(needs.generate-matrix.outputs.matrix-metadata).include[0] }} # skip if the matrix is empty! + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pietrobolcato/action-read-yaml@1.0.0 + id: metadata + with: + config: ${{ github.workspace }}/docker/${{ matrix.image_dir }}/meta.yml + - name: Get date + id: date + run: | + echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT + - name: Login to DockerHub + #if: github.event_name != 'pull_request' + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 + - name: Build and push + uses: docker/build-push-action@v4 + # only try building & pushing the container if parsing the metadata worked + if: ${{ steps.metadata.outputs['container'] != '' }} with: - push: true - tags: user/app:latest \ No newline at end of file + context: docker/${{ matrix.image_dir }} + # only push container to docker hub if not triggered from a PR + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs['container'] }} + build-args: | + BUILD_DATE=${{ steps.date.outputs.DATE }} + BUILD_TAG=${{ steps.metadata.outputs['version'] }} + REPONAME=${{ steps.metadata.outputs['image_name'] }} \ No newline at end of file diff --git a/docker/logan_base/meta.yml b/docker/logan_base/meta.yml new file mode 100644 index 0000000..b1a3033 --- /dev/null +++ b/docker/logan_base/meta.yml @@ -0,0 +1,4 @@ +dockerhub_namespace: dnousome +image_name: ccbr_logan_base +version: v0.3.1 +container: "$(dockerhub_namespace)/$(image_name):$(version)" diff --git a/nextflow.config b/nextflow.config index f578f01..00dfaad 100644 --- a/nextflow.config +++ b/nextflow.config @@ -54,7 +54,7 @@ profiles { process { executor = 'local' withName:fc_lane { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName:fastq_screen { container= 'docker://nciccbr/ccbr_fastq_screen_0.13.0:v2.0' @@ -69,7 +69,7 @@ profiles { container= 'docker://nciccbr/ccbr_qualimap:v0.0.1' } withName: 'samtools_flagstats|vcftools|bcftools_stats|gatk_varianteval|snpeff|somalier_extract|somalier_analysis' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName: 'multiqc' { container= 'docker://nciccbr/ccbr_multiqc_1.9:v0.0.1' @@ -78,22 +78,22 @@ profiles { container= 'docker://nciccbr/ccbr_picard:v0.0.1' } withName: 'fastp|bwamem2|indelrealign|bqsr|gatherbqsr|samtoolsindex|applybqsr' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName:'mutect2|mutect2_t|mutect2_t_tonly|mutect2filter|mutect2filter_tonly|learnreadorientationmodel|learnreadorientationmodel_tonly|contamination_paired|contamination_tumoronly|pileup_paired_t|pileup_paired_n|pileup_paired_tonly' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName: 'strelka_tn|vardict_tn|vardict_tonly|varscan_tn|varscan_tonly|combineVariants|combineVariants_strelka' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName: 'annotvep_tn|annotvep_tonly' { container= 'docker://dnousome/ccbr_vcf2maf:v102.0.0' } withName: 'svaba_somatic|manta_somatic' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName: 'sequenza' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } @@ -152,88 +152,88 @@ profiles { cpus=8 } withName:fastp { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory=24.GB time=24.h cpus=4 } withName:fc_lane { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' } withName:bwamem2 { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory=200.GB time=48.h cpus=17 } withName:indelrealign{ - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory=48.GB time=72.h cpus=16 } withName:bqsr{ - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 32.GB time= 48.h } withName:gatherbqsr{ - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 16.GB time= 2.h } withName:applybqsr{ - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 48.GB time= 48.h } withName:samtoolsindex{ - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 16.GB time= 12.h cpus= 4 } withName: 'mutect2|mutect2_t|mutect2_t_tonly' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 48.GB cpus= 4 time= 72.h } withName: 'vardict_tn|vardict_tonly|varscan_tn|varscan_tonly|combineVariants|combineVariants_strelka' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 32.GB cpus= 2 time= 72.h } withName: 'strelka_tn' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 48.GB cpus= 16 time= 72.h } withName:'mutect2filter|mutect2filter_tonly' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 24.GB time= 24.h cpus= 4 } withName:'contamination_paired|contamination_tumoronly'{ - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 24.GB time= 24.h } withName:'learnreadorientationmodel|learnreadorientationmodel_tonly' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 48.GB time= 24.h } withName:'mergemut2stats|mergemut2stats_tonly' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 16.GB time= 24.h } withName:'pileup_paired_t|pileup_paired_n|pileup_paired_tonly' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 16.GB time= 12.h } @@ -273,12 +273,12 @@ profiles { scratch='/lscratch/$SLURM_JOB_ID/dv' } withName:'somalier_extract|somalier_analysis' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 16.GB time= 12.h } withName:'gatk_varianteval' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 16.GB time= 12.h } @@ -295,13 +295,13 @@ profiles { cpus=16 } withName:'svaba_somatic|manta_somatic' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 64.GB time= 24.h cpus=16 } withName: 'sequenza' { - container= 'docker://dnousome/ccbr_logan_base:v0.3.0' + container= 'docker://dnousome/ccbr_logan_base:v0.3.1' memory= 64.GB time= 24.h cpus=12