-
Notifications
You must be signed in to change notification settings - Fork 16
76 lines (73 loc) · 3.13 KB
/
docker-image.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Docker Image CI
on:
push:
branches:
- master
- demo-*
pull_request:
# Only use GitHub Actions for testing, because the Docker image with Mutation Assessor data is too big to be built and pushed.
# CircleCI builds and pushes the images to Docker Hub for every new release.
jobs:
build_and_publish_grch37:
if: github.repository == 'genome-nexus/genome-nexus-importer'
runs-on: ubuntu-latest
steps:
- name: 'Checkout git repo'
uses: actions/checkout@v1
- name: Install xz-utils
run: sudo apt-get update && sudo apt-get install -y xz-utils
- name: Extract branch or tag name
# The GITHUB_REF variable is like "refs/head/branch_name" or
# "refs/tag/tag_name". If the tag is prefixed with v, this is a new
# version and we want to push it with the tag "latest" as well. One can give
# the same image multiple tags by using ","
run: echo "##[set-output name=image_tag_names;]$(echo ${GITHUB_REF##*/} | sed 's/^v/latest,/g')"
id: extract_tags
- name: 'Docker build with cache'
uses: whoan/docker-build-with-cache-action@v5
with:
image_name: genomenexus/gn-mongo
image_tag: ${{ steps.extract_tags.outputs.image_tag_names }}
push_image_and_stages: false
build_and_publish_grch38:
if: github.repository == 'genome-nexus/genome-nexus-importer'
runs-on: ubuntu-latest
env:
Version: grch38_ensembl95
steps:
- name: 'Checkout git repo'
uses: actions/checkout@v1
- name: Install xz-utils
run: sudo apt-get update && sudo apt-get install -y xz-utils
- name: Extract branch or tag name
# The GITHUB_REF variable is like "refs/head/branch_name"
# The format of image tag is e.g. v0.12_grch38_ensembl95
run: echo "##[set-output name=image_tag_name;]${GITHUB_REF##*/}_${Version}"
id: extract_tag
- name: 'Docker build with cache'
uses: whoan/docker-build-with-cache-action@v5
with:
build_extra_args: '{"--build-arg": "ARG_REF_ENSEMBL_VERSION=grch38_ensembl95"}'
image_name: genomenexus/gn-mongo
image_tag: ${{ steps.extract_tag.outputs.image_tag_name }}
push_image_and_stages: false
build_and_publish_grcm38:
if: github.repository == 'genome-nexus/genome-nexus-importer'
runs-on: ubuntu-latest
env:
Version: grcm38_ensembl95
steps:
- name: 'Checkout git repo'
uses: actions/checkout@v1
- name: Extract branch or tag name
# The GITHUB_REF variable is like "refs/head/branch_name"
# The format of image tag is e.g. v0.12_grch38_ensembl95
run: echo "##[set-output name=image_tag_names;]$(echo ${GITHUB_REF##*/}_${Version})"
id: extract_tags
- name: 'Docker build with cache'
uses: whoan/docker-build-with-cache-action@v5
with:
build_extra_args: '--build-arg SPECIES=mus_musculus --build-arg REF_ENSEMBL_VERSION=grcm38_ensembl95'
image_name: genomenexus/gn-mongo
image_tag: ${{ steps.extract_tags.outputs.image_tag_names }}
push_image_and_stages: false