Merge pull request #13 from MatthiasZepper/Improved_thread_setting #8
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 container images | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- '**.rs' | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
push_to_registry: | |
if: ( github.repository == 'SciLifeLab/umi-transfer' || github.repository == 'MatthiasZepper/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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Change repo name to lowercase and set environment variables | |
run: | | |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push dev image | |
uses: docker/build-push-action@v5 | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
with: | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOTITLE_LOWERCASE }}:dev | |
ghcr.io/${{ env.REPO_LOWERCASE }}:dev | |
- name: Push release image | |
uses: docker/build-push-action@v5 | |
if: github.event_name == 'release' | |
with: | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOTITLE_LOWERCASE }}:${{ github.event.release.tag_name }} | |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOTITLE_LOWERCASE }}:latest | |
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.event.release.tag_name }} | |
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.sha }} | |
ghcr.io/${{ env.REPO_LOWERCASE }}:latest |