forked from vincent-noel/WebMaBoSS
-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (61 loc) · 2.47 KB
/
deploy-docker.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
name: Linux
on:
push:
pull_request:
release:
types: [created]
jobs:
publish_docker_hub:
name: Publishing WebMaBoSS docker to DockerHub
runs-on: ubuntu-22.04
if: github.event_name == 'release' && github.event.action == 'created' && github.repository == 'sysbio-curie/WebMaBoSS'
steps:
- uses: actions/checkout@v4
- name: Start WebMaBoSS docker
run: |
docker-compose build webmaboss
- name: Connect Docker Hub
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Upload Docker Hub
run: |
docker tag webmaboss:${{ github.event.release.tag_name }} webmaboss:latest
docker tag webmaboss:latest vnoel/webmaboss:latest
docker tag webmaboss:${{ github.event.release.tag_name }} vnoel/webmaboss:${{ github.event.release.tag_name }}
docker push vnoel/webmaboss:latest
docker push vnoel/webmaboss:${{ github.event.release.tag_name }}
docker tag webmaboss:latest sysbiocurie/webmaboss:latest
docker tag webmaboss:${{ github.event.release.tag_name }} sysbiocurie/webmaboss:${{ github.event.release.tag_name }}
docker push sysbiocurie/webmaboss:latest
docker push sysbiocurie/webmaboss:${{ github.event.release.tag_name }}
publish_docker_github:
name: Publishing WebMaBoSS docker container to GitHub
runs-on: ubuntu-22.04
if: github.event_name == 'release' && github.event.action == 'created' && github.repository == 'sysbio-curie/MaBoSS'
env:
REGISTRY: ghcr.io
IMAGE_NAME: webmaboss
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}