Skip to content

Merge pull request #51 from SCiO-systems/gdal-update #21

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

Merge pull request #51 from SCiO-systems/gdal-update #21

name: Build and Push Docker Images (jupyter-eiaspatial-notebook-jammy)
on:
push:
branches:
- develop
- main
paths:
- ".github/workflows/pipeline-jupyter-eiaspatial-notebook-jammy.yml"
- "jupyter-eiaspatial-notebook-jammy/**"
permissions:
contents: read
jobs:
build_and_push_dev:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/develop')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short SHA
uses: benjlevesque/short-sha@v3.0
id: short-sha
with:
length: 7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push Docker Image (dev)
uses: docker/build-push-action@v5
with:
context: ./jupyter-eiaspatial-notebook-jammy
file: ./jupyter-eiaspatial-notebook-jammy/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:dev-jammy-${{ secrets.JUPYTER_EIASPATIAL_NOTEBOOK_RELEASE_VERSION }}-${{ steps.short-sha.outputs.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:dev-jammy-${{ secrets.JUPYTER_EIASPATIAL_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@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Pull "dev" Docker image
run: docker pull ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:dev-jammy-${{ secrets.JUPYTER_EIASPATIAL_NOTEBOOK_RELEASE_VERSION }}
- name: Tag producion Docker image
run: docker tag ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:dev-jammy-${{ secrets.JUPYTER_EIASPATIAL_NOTEBOOK_RELEASE_VERSION }} ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:jammy-${{ secrets.JUPYTER_EIASPATIAL_NOTEBOOK_RELEASE_VERSION }}
- name: Push Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:jammy-${{ secrets.JUPYTER_EIASPATIAL_NOTEBOOK_RELEASE_VERSION }}
- name: Tag producion Docker image (non specified version)
run: docker tag ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:jammy-${{ secrets.JUPYTER_EIASPATIAL_NOTEBOOK_RELEASE_VERSION }} ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:jammy
- name: Push Docker image (non specified version)
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/jupyter-eiaspatial-notebook:jammy