-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (37 loc) · 1.3 KB
/
docker_chen2021Fitness.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
name: Docker (chen2021Fitness)
on:
workflow_dispatch:
push:
branches:
paths:
- 'ext_models/chen2021Fitness/**'
env:
IMAGE_NAME: ghcr.io/genspectrum/cov-spectrum-chen2021fitness
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set environment variable "BRANCH"
run: |
echo "BRANCH=$(eval 'echo $GITHUB_REF | sed s/refs\\/heads\\/// | sed s/\\//__/ ')" >> $GITHUB_ENV
- name: Build image
run: |
cd ext_models/chen2021Fitness
docker build -t new_image .
- name: Login to Github Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Add tags and push
run: |
docker tag new_image ${{ env.IMAGE_NAME }}:br-${{ env.BRANCH }}
docker push ${{ env.IMAGE_NAME }}:br-${{ env.BRANCH }}
- name: Add "develop" tag and push
if: env.BRANCH == 'develop'
run: |
docker tag new_image ${{ env.IMAGE_NAME }}:develop
docker push ${{ env.IMAGE_NAME }}:develop
- name: Add "public" tag and push
if: env.BRANCH == 'public'
run: |
docker tag new_image ${{ env.IMAGE_NAME }}:public
docker push ${{ env.IMAGE_NAME }}:public