forked from vincent-noel/WebMaBoSS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding workflow to deploy docker images
- Loading branch information
1 parent
24fde9c
commit dc14c43
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Linux | ||
|
||
on: | ||
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 }} | ||
|