Skip to content

Merge pull request #50 from SCiO-systems/gdal-update #6

Merge pull request #50 from SCiO-systems/gdal-update

Merge pull request #50 from SCiO-systems/gdal-update #6

name: Build and Push Docker Images (jupyter-eiar-notebook)
on:
push:
branches:
- develop
- main
paths:
- ".github/workflows/pipeline-jupyter-eiar-notebook.yml"
- "jupyter-eiar-notebook/**"
permissions:
contents: read
jobs:
build_and_push_dev:
runs-on: "self-hosted"
if: startsWith(github.ref, 'refs/heads/develop')
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get short SHA
uses: benjlevesque/short-sha@v2.2
id: short-sha
with:
length: 7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push Docker Image (dev)
uses: docker/build-push-action@v4
with:
context: ./jupyter-eiar-notebook
file: ./jupyter-eiar-notebook/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:dev-${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }}-${{ steps.short-sha.outputs.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:dev-${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
build_and_push_prod:
runs-on: "self-hosted"
if: startsWith(github.ref, 'refs/heads/main')
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Pull "dev" Docker image
run: docker pull ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:dev-${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }}
- name: Tag producion Docker image
run: docker tag ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:dev-${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }} ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }}
- name: Push Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }}
- name: Tag producion Docker image (non specified version)
run: docker tag ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook:${{ secrets.JUPYTER_EIAR_NOTEBOOK_RELEASE_VERSION }} ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook
- name: Push Docker image (non specified version)
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiar-notebook