Skip to content

Updated git repo structure (docker). #55

Updated git repo structure (docker).

Updated git repo structure (docker). #55

name: docker-jupyter-singleuser
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
platform: [amd64, arm64]
include:
- platform: amd64
runner: ubuntu-22.04
- platform: arm64
runner: ubuntu-22.04-arm
env:
working-directory: ./
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
# Update references for any submodules
- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
git pull --recurse-submodules origin master
git submodule update --remote --recursive
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: cogstacksystems/jupyter-singleuser:latest
- name: Get and set release version env var
id: release_version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "::set-output name=RELEASE_VERSION::$RELEASE_VERSION"
- name: output test
run: |
echo ${{ env.RELEASE_VERSION }}
echo $RELEASE_VERSION
- name: set docker release tag name
id: set_release_version
if: ${{ env.RELEASE_VERSION != 'master' }}
run: echo "RELEASE_VERSION=${RELEASE_VERSION#?}" >> $GITHUB_ENV
- name: set docker release tag name
id: set_release_version_latest
if: ${{ env.RELEASE_VERSION == 'master' }}
run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
- name: set CPU architecture
id: set_cpu_architecture
run: echo "CPU_ARCHITECTURE=${{ matrix.platform }}" >> $GITHUB_ENV
- name: Build and push Docker Jupyter singleuser image
run: |
docker build --platform linux/${{ matrix.platform }} -t cogstacksystems/jupyter-singleuser:${{ env.RELEASE_VERSION }}-${{ matrix.platform }} -f Dockerfile_singleuser --build-arg CPU_ARCHITECTURE=${{ matrix.platform }} .
docker push cogstacksystems/jupyter-singleuser:${{ env.RELEASE_VERSION }}-${{ matrix.platform }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}