forked from clinical-genomics-uppsala/Twist_DNA
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.2 KB
/
build_somatic_docker_manually.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This is a basic workflow to help you get started with Actions
name: somatic manually
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
docker_version_release:
name: docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Log into registry
run: echo "${{ secrets.HUB_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY_URL }} -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
- name: Build and push the images
run: |
folder="dockerfiles/somatic"
IMAGE_NAME=${folder##*/}
tmpName="image-$RANDOM"
docker build $folder --file $folder/Dockerfile --tag $tmpName
IMAGE_ID=${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.REPOSITORY }}/$IMAGE_NAME
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $tmpName $IMAGE_ID:VERSION
docker push $IMAGE_ID:$VERSION