Merge pull request #2 from SciLifeLab/First_Draft #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Dockerhub | |
on: | |
push: | |
branches: | |
- main | |
- 'releases/**' | |
- AddCIpipelines | |
tags: | |
- 'v*' #if a push with a version tag like v0.0.2 is recorded | |
release: | |
types: [published] | |
jobs: | |
push_to_registry: | |
if: github.repository == 'SciLifeLab/umi-transfer' | |
name: Push Docker image to Docker Hub / GitHub Docker Registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Change repo name to lowercase | |
run: | | |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push dev image | |
uses: docker/build-push-action@v2 | |
if: github.event_name == 'push' | |
with: | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:dev | |
ghcr.io/${{ env.REPO_LOWERCASE }}:dev | |
- name: Push release image | |
uses: docker/build-push-action@v2 | |
if: github.event_name == 'release' | |
with: | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:${{ github.event.release.tag_name }} | |
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:latest | |
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.event.release.tag_name }} | |
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.sha }} | |
ghcr.io/${{ env.REPO_LOWERCASE }}:latest |