Skip to content

⬆️ Upgrade Jupyter image #111

⬆️ Upgrade Jupyter image

⬆️ Upgrade Jupyter image #111

---
name: JupyterLab - test and build
on:
pull_request:
push:
branches: [main]
tags: "*"
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
- name: Run yaml Lint
uses: actionshub/yamllint@main
mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
- name: Run Markdown Lint
uses: actionshub/markdownlint@main
docker:
runs-on: [self-hosted, management-ecr]
strategy:
fail-fast: false
max-parallel: 3
matrix:
flavour:
- "datascience-notebook"
- "allspark-notebook"
- "oracle-datascience-notebook"
env:
REPOSITORY: ${{ matrix.flavour }}
ECR_REPOSITORY: ${{ matrix.flavour }}
needs: [mdl, yamllint]
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::593291632749:role/github-actions-management-ecr
role-duration-seconds: 1200
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registries: 593291632749
- name: Check out code
uses: actions/checkout@v2
- name: Prep Tags
id: prep
run: |
TAG=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
TAG=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$TAG" ]; then
TAG=edge
fi
elif [[ $GITHUB_REF == refs/pull/* ]]; then
TAG=pr-${{ github.event.number }}
elif [ "${{ github.event_name }}" = "push" ]; then
TAG="sha-${GITHUB_SHA::8}"
fi
echo "Docker image tag = '$TAG'"
echo ::set-output name=tag::${TAG}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Build image
working-directory: "./${{ matrix.flavour }}"
run: make build
env:
NETWORK: host
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.prep.outputs.tag }}
- name: Install InSpec
uses: actionshub/chef-install@main
with:
channel: current
project: inspec
- name: Test
working-directory: "./${{ matrix.flavour }}"
run: make test
env:
NETWORK: host
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.prep.outputs.tag }}
- name: Push image
working-directory: "./${{ matrix.flavour }}"
run: make push
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.prep.outputs.tag }}
- name: Cleanup
if: ${{ always() }}
working-directory: "./${{ matrix.flavour }}"
run: make clean
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.prep.outputs.tag }}