Skip to content

feat(image-components): add jupyter-devops image components #1

feat(image-components): add jupyter-devops image components

feat(image-components): add jupyter-devops image components #1

name: jupyter-devops
on:
push:
branches:
# - 'main'
- 'test-packages'
paths:
- "jupyter/devops/**"
- "!jupyter/devops/README.md"
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Read version from file
id: version
run: echo "::set-output name=VERSION::$(cat ./jupyter/devops/version.txt)"
- name: Build and push Docker image
env:
DOCKERFILE_PATH: jupyter/devops/Dockerfile
IMAGE_TAG: ${{ steps.version.outputs.VERSION }}
IMAGE_ARG: kubespacedev/jupyter:latest
IMAGE_REF: kubespacedev/jupyter-devops:${{ steps.version.outputs.VERSION }}
IMAGE_LAST: kubespacedev/jupyter-devops:latest
run: |
docker build -t ${{ env.IMAGE_REF }} --build-arg IMAGE=${{ env.IMAGE_ARG }} -f ${{ env.DOCKERFILE_PATH }} .
docker push ${{ env.IMAGE_REF }}
docker tag ${{ env.IMAGE_REF }} ${{ env.IMAGE_LAST }}
docker push ${{ env.IMAGE_LAST }}