forked from OpenMS/OpenMS
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (70 loc) · 2.55 KB
/
dockerdeploy.yml
File metadata and controls
71 lines (70 loc) · 2.55 KB
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
name: deploy-docker-images
on:
workflow_dispatch:
push:
branches:
- nightly
- 'release/**'
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Define tag name
shell: bash
run: |
BRANCH=${{ steps.extract_branch.outputs.branch }}
## use latest to follow docker conventions
if [[ "$BRANCH" == "develop" ]]
then
BRANCH="latest"
fi
if [[ "$BRANCH" == "nightly" ]]
then
BRANCH="latest"
fi
## Remove release/ from release branch name
echo "##[set-output name=tag;]$(echo ${BRANCH#release/})"
id: tag_name
- name: Downcase REPO
run: echo "##[set-output name=repo;]$(echo ${GITHUB_REPOSITORY,,})"
id: downcase_repo
- name: Checkout Dockerfiles
shell: bash # uses git bash on windows
run: |
git clone https://github.com/OpenMS/dockerfiles
cd dockerfiles
## for release, try to checkout the specific release branch in the dockerfiles repo first
if [[ "${{ steps.extract_branch.outputs.branch }}" == "release/"* ]]
then
git checkout ${{ steps.extract_branch.outputs.branch }} || git checkout master
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: jpfeuffer
password: ${{ secrets.GH_REGISTRY_TOKEN }}
- name: Build and Push Docker Library Image
uses: docker/build-push-action@v2
with:
push: true # Will only build if this is not here
context: dockerfiles/library
build-args: |
OPENMS_TAG=latest
OPENMS_BRANCH=${{ steps.extract_branch.outputs.branch }}
tags: |
ghcr.io/${{ steps.downcase_repo.outputs.repo }}-library:${{ steps.tag_name.outputs.tag }}
- name: Build and Push Docker Tools Image
uses: docker/build-push-action@v2
with:
push: true # Will only build if this is not here
context: dockerfiles/executables
build-args: |
OPENMS_TAG=latest
OPENMS_BRANCH=${{ steps.extract_branch.outputs.branch }}
tags: |
ghcr.io/${{ steps.downcase_repo.outputs.repo }}-executables:${{ steps.tag_name.outputs.tag }}