Skip to content

Commit

Permalink
Split up dockerhub push workflows, don't limit aws to a branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Nov 11, 2020
1 parent f228d88 commit 07e0833
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/awsfulltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ name: nf-core AWS full size tests

on:
workflow_run:
workflows: ["nf-core Docker push"]
branches: [master]
workflows: ["nf-core Docker push (release)"]
types: [completed]

jobs:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/push_dockerhub_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: nf-core Docker push (dev)
# This builds the docker image and pushes it to DockerHub
# Runs on nf-core repo releases and push event to 'dev' branch (PR merges)
on:
push:
branches:
- dev

jobs:
push_dockerhub:
name: Push new dev Docker image to Docker Hub
runs-on: ubuntu-latest
# Only run for the nf-core repo, for releases and merged PRs
if: ${{ github.repository == 'nf-core/testpipeline' }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
steps:
- name: Check out pipeline code
uses: actions/checkout@v2

- name: Build new docker image
run: docker build --no-cache . -t nfcore/testpipeline:dev

- name: Push Docker image to DockerHub (dev)
run: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push nfcore/testpipeline:dev
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: nf-core Docker push
name: nf-core Docker push (release)
# This builds the docker image and pushes it to DockerHub
# Runs on nf-core repo releases and push event to 'dev' branch (PR merges)
on:
push:
branches:
- dev
release:
types: [published]

Expand All @@ -24,13 +21,6 @@ jobs:
- name: Build new docker image
run: docker build --no-cache . -t nfcore/testpipeline:latest

- name: Push Docker image to DockerHub (dev)
if: ${{ github.event_name == 'push' }}
run: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker tag nfcore/testpipeline:latest nfcore/testpipeline:dev
docker push nfcore/testpipeline:dev
- name: Push Docker image to DockerHub (release)
if: ${{ github.event_name == 'release' }}
run: |
Expand Down

0 comments on commit 07e0833

Please sign in to comment.