Skip to content

Update versions ISIS/ASP #72

Update versions ISIS/ASP

Update versions ISIS/ASP #72

Workflow file for this run

# Build and publish container images
#
# There are three images in this repo we want to build and publish individually:
# - GISPy
# - ISIS
# - ASP
#
# The images should be tagged as 'latest' and "$VERSION", where the version
# will point unequivocally to a git commit/tag of this repo.
# 'latest' will be the latest version of repository in 'stable' branch.
#
# Reference docs:
# - docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: Build and Publish Containers
# Controls when the action will run. Triggers the workflow on push request, or repository dispatch
on:
# Runs when pushing to 'stable' branch
push:
branches:
- 'test'
# - 'stable'
# branches-ignore:
# - 'master'
tags:
- '*'
# Run in every PR too
# pull_request:
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
jobs:
# gispy:
# uses: ./.github/workflows/workflow_build.yml
# with:
# image_name: ${{ vars.DOCKERHUB_USERNAME }}/jupyter-gispy
# context_path: ./dockerfiles
# dockerfile_path: ./dockerfiles/gispy.dockerfile
# secrets: inherit
# isis:
# uses: ./.github/workflows/workflow_build.yml
# with:
# image_name: ${{ vars.DOCKERHUB_USERNAME }}/jupyter-isis
# context_path: ./dockerfiles
# dockerfile_path: ./dockerfiles/isis.dockerfile
# secrets: inherit
gispy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dockerfiles
env:
USER_ORG: ${{ vars.DOCKERHUB_NAMESPACE }}
SERVICE: jupyter-gispy
REPO: ${USER_ORG}/${SERVICE}
steps:
- # https://github.com/marketplace/actions/checkout
name: Checkout
uses: actions/checkout@v4
- name: Build image
run: |
docker compose build ${{ env.SERVICE }}
- name: Tag image
if: ${{ github.event_name == 'push' }}
run: |
NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
docker tag $NEW_IMAGE ${{ env.REPO }}:$GITHUB_REF_NAME
- name: Tag 'latest' image
if: ${{ github.ref_type == 'tag' }}
run: |
NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
docker tag $NEW_IMAGE ${{ env.REPO }}:latest
# DATE=`date +%Y%m%d`
# docker tag $NEW_IMAGE ${{ env.REPO }}:$DATE
# - name: Tag image with SHA hash
# if: ${{ github.event_name == 'push' }}
# run: |
# IMAGE_SHA=`docker images -q $NEW_IMAGE`
# docker tag $NEW_IMAGE ${USERNAME}/jupyter-gispy:$IMAGE_SHA
- # https://github.com/marketplace/actions/docker-login
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image
run: >
docker image ls
| tail -n+2 | awk '{print $1":"$2}'
| grep "${{ env.REPO }}"
| xargs -I'{}' docker push {}
isis:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dockerfiles
env:
USER_ORG: ${{ vars.DOCKERHUB_NAMESPACE }}
SERVICE: jupyter-isis
REPO: ${USER_ORG}/${SERVICE}
steps:
- # https://github.com/marketplace/actions/checkout
name: Checkout
uses: actions/checkout@v4
- name: Load .env file
run: |
source .env
echo "ISIS_VERSION=${ISIS_VERSION}" >> $GITHUB_ENV
- name: Build image
run: |
docker compose build ${{ env.SERVICE }}
- name: Tag image
if: ${{ github.event_name == 'push' }}
run: |
NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
echo "docker tag $NEW_IMAGE ${{ env.REPO }}:$GITHUB_REF_NAME"
docker tag $NEW_IMAGE ${{ env.REPO }}:$GITHUB_REF_NAME
- name: Tag 'latest' image
if: ${{ github.ref_type == 'tag' }}
run: |
NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
docker tag $NEW_IMAGE ${{ env.REPO }}:${ISIS_VERSION}
docker tag $NEW_IMAGE ${{ env.REPO }}:latest
# DATE=`date +%Y%m%d`
# docker tag $NEW_IMAGE ${{ env.REPO }}:$DATE
# - name: Tag image with SHA hash
# if: ${{ github.event_name == 'push' }}
# run: |
# IMAGE_SHA=`docker images -q $NEW_IMAGE`
# docker tag $NEW_IMAGE ${USERNAME}/jupyter-gispy:$IMAGE_SHA
- # https://github.com/marketplace/actions/docker-login
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image
run: >
docker image ls
| tail -n+2 | awk '{print $1":"$2}'
| grep "${{ env.REPO }}"
| xargs -I'{}' docker push {}
# - name: Save image
# run: |
# cd dockerfiles/
# NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
# docker save --output /tmp/image.tar $NEW_IMAGE
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: isis_image
# path: /tmp/image.tar
- name: List images
run: |
docker image ls -a
isis-asp:
needs: isis
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dockerfiles
env:
USER_ORG: ${{ vars.DOCKERHUB_NAMESPACE }}
SERVICE: jupyter-isis-asp
REPO: ${USER_ORG}/${SERVICE}
steps:
- # https://github.com/marketplace/actions/checkout
name: Checkout
uses: actions/checkout@v4
# - name: Download artifact
# uses: actions/download-artifact@v3
# with:
# name: isis_image
# path: /tmp
# - name: Load image
# run: |
# docker load --input /tmp/image.tar
# docker image ls -a
- name: Load .env file
run: |
source .env
echo "ISIS_VERSION=${ISIS_VERSION}" >> $GITHUB_ENV
echo "ASP_VERSION=${ASP_VERSION}" >> $GITHUB_ENV
- name: List images
run: |
docker image ls -a
- name: Build image
run: |
ISIS_IMAGE=${{ env.USER_ORG }}/jupyter-isis:${GITHUB_REF_NAME}
echo "docker compose build --build-arg BASE_IMAGE=${ISIS_IMAGE} ${{ env.SERVICE }}"
docker compose build --build-arg BASE_IMAGE=${ISIS_IMAGE} ${{ env.SERVICE }}
- name: Tag image
if: ${{ github.event_name == 'push' }}
run: |
NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
echo "$NEW_IMAGE"
echo "docker tag $NEW_IMAGE ${{ env.REPO }}:$GITHUB_REF_NAME"
docker tag $NEW_IMAGE ${{ env.REPO }}:$GITHUB_REF_NAME
- name: Tag 'latest' image
if: ${{ github.ref_type == 'tag' }}
run: |
NEW_IMAGE=`docker compose config --images ${{ env.SERVICE }}`
docker tag $NEW_IMAGE ${{ env.REPO }}:latest
docker tag $NEW_IMAGE ${{ env.REPO }}:${ISIS_VERSION}-${ASP_VERSION}
# DATE=`date +%Y%m%d`
# docker tag $NEW_IMAGE ${{ env.REPO }}:$DATE
# - name: Tag image with SHA hash
# if: ${{ github.event_name == 'push' }}
# run: |
# IMAGE_SHA=`docker images -q $NEW_IMAGE`
# docker tag $NEW_IMAGE ${USERNAME}/jupyter-gispy:$IMAGE_SHA
- # https://github.com/marketplace/actions/docker-login
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image
run: >
docker image ls
| tail -n+2 | awk '{print $1":"$2}'
| grep "${{ env.REPO }}"
| xargs -I'{}' docker push {}
- name: List images
run: |
docker image ls -a