From 41981b8ea3575a23b7641eb868d9c883086208b3 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Wed, 22 Mar 2023 10:42:27 -0700 Subject: [PATCH] rebased on datahub example notebook --- .github/workflows/docker.yml | 56 ++++++++++++++++++++---------------- Dockerfile | 2 +- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0c8e972..60168d2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,35 +1,41 @@ -name: Docker Workflow - +name: Build notebook on: + schedule: + - cron: '0 2 * * *' push: - branches: - - main - - master - # paths: - # - "requirements.txt" - # - "Dockerfile" - # - ".github/workflows/main.yml" - workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: - docker: + build-and-push-image: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub + - name: Checkout notebook + uses: actions/checkout@v3 + + - name: Log in to registry uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate tags and labels + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push notebook + uses: docker/build-push-action@v4 with: + context: . push: true - tags: ucsdets/extcse41305-notebook:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 3fbd74c..b94a07f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # base notebook, contains Jupyter and relevant tools # See https://github.com/ucsd-ets/datahub-docker-stack/wiki/Stable-Tag # for a list of the most current containers we maintain -ARG BASE_CONTAINER=ucsdets/datahub-base-notebook:2022.3-stable +ARG BASE_CONTAINER=ucsdets/datahub-base-notebook:2023.2-stable FROM $BASE_CONTAINER