Skip to content

Commit

Permalink
Add Dockerfile and Docker publish workflow (#61)
Browse files Browse the repository at this point in the history
* Add Dockerfile and Docker publish workflow

* Bump version to 2.2.7
  • Loading branch information
rvhonorato authored Apr 15, 2024
1 parent ea519f3 commit 48d6ff8
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
name: Create and publish a Docker image

on:
push:
# run only against tags
tags:
- "*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#==============================================================================================
FROM python:3.11
WORKDIR /opt/software
COPY . .
RUN pip install .
WORKDIR /data
ENTRYPOINT [ "fandas" ]
#==============================================================================================
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name="FANDAS",
license="Apache License 2.0",
version="2.2.6",
version="2.2.7",
author="Siddarth Narasimhan, Rodrigo Honorato",
description="Fast Analysis of multidimensional NMR DAta Sets",
author_email="",
Expand Down
2 changes: 1 addition & 1 deletion src/fandas/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "2.2.6"
VERSION = "2.2.7"
v_major, v_minor, v_patch = VERSION.split(".")

0 comments on commit 48d6ff8

Please sign in to comment.