diff --git a/.github/workflows/build-test-publish-all.yml b/.github/workflows/build-test-publish-all.yml deleted file mode 100644 index 965e3bf..0000000 --- a/.github/workflows/build-test-publish-all.yml +++ /dev/null @@ -1,88 +0,0 @@ ---- -name: Build, Test, and Publish an Image - -on: - workflow_call: - inputs: - runs-on: - description: The platform to run the action on - type: string - required: false - default: ubuntu-latest - publish: - description: Whether to publish the image to remote registries - type: boolean - required: false - default: false - -jobs: - base-r: - uses: ./.github/workflows/build-test-publish.yml - secrets: inherit - with: - runs-on: ${{ inputs.runs-on }} - image: base-r-notebook - labels: | - org.opencontainers.image.title=Base R Notebook - org.opencontainers.image.description=Jupyter Lab, Python, and R, and that's it. - tags: | - type=raw,value=python-3.11 - type=raw,value=r-4.3 - build-args: | - PYTHON_VERSION=3.11 - R_VERSION=4.3 - publish: ${{ inputs.publish }} - - essentials: - needs: [base-r] - uses: ./.github/workflows/build-test-publish.yml - secrets: inherit - with: - runs-on: ${{ inputs.runs-on }} - image: essentials-notebook - labels: | - org.opencontainers.image.title=Essentials Notebook - org.opencontainers.image.description=CourseKata essentials: everything used in the books. - tags: | - type=raw,value=python-3.11 - type=raw,value=r-4.3 - build-args: | - BASE_IMAGE=${{ needs.base-r.outputs.image }}@${{ needs.base-r.outputs.digest}} - PARENT_IMAGE=${{ needs.base-r.outputs.image }} - publish: ${{ inputs.publish }} - - r: - needs: [base-r, essentials] - uses: ./.github/workflows/build-test-publish.yml - secrets: inherit - with: - runs-on: ${{ inputs.runs-on }} - image: r-notebook - labels: | - org.opencontainers.image.title=R Notebook - org.opencontainers.image.description=CourseKata essentials and other R packages for teaching and learning data science. - tags: | - type=raw,value=python-3.11 - type=raw,value=r-4.3 - build-args: | - BASE_IMAGE=${{ needs.base-r.outputs.image }}@${{ needs.base-r.outputs.digest}} - PARENT_IMAGE=${{ needs.essentials.outputs.image }}@${{ needs.essentials.outputs.digest}} - publish: ${{ inputs.publish }} - - datascience: - needs: [base-r, r] - uses: ./.github/workflows/build-test-publish.yml - secrets: inherit - with: - runs-on: ${{ inputs.runs-on }} - image: datascience-notebook - labels: | - org.opencontainers.image.title=Data Science Notebook - org.opencontainers.image.description=R and Python packages for teaching and learning data science. - tags: | - type=raw,value=python-3.11 - type=raw,value=r-4.3 - build-args: | - BASE_IMAGE=${{ needs.base-r.outputs.image }}@${{ needs.base-r.outputs.digest}} - PARENT_IMAGE=${{ needs.r.outputs.image }}@${{ needs.r.outputs.digest}} - publish: ${{ inputs.publish }} diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index e6adbd7..1cbb957 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -35,6 +35,7 @@ on: description: Labels to add to the image type: string required: false + outputs: image: description: The image name diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eeabb20..b569347 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,19 +4,15 @@ name: Publish images on: workflow_dispatch: push: - branches: [main] + branches: [test/*] paths: - .github/workflows/publish.yml - .github/workflows/build-test-publish.yml - - .github/workflows/build-test-publish-all.yml - tests/** - base-r-notebook/** - essentials-notebook/** - r-notebook/** - datascience-notebook/** - schedule: - # Weekly, at 03:00 on Monday UTC time (see https://crontab.guru) - - cron: "0 3 * * 1" # https://docs.github.com/en/actions/using-jobs/using-concurrency concurrency: @@ -25,8 +21,69 @@ concurrency: cancel-in-progress: true jobs: - publish: - uses: ./.github/workflows/build-test-publish-all.yml + base-r: + uses: ./.github/workflows/build-test-publish.yml secrets: inherit with: + image: base-r-notebook + labels: | + org.opencontainers.image.title=Base R Notebook + org.opencontainers.image.description=Jupyter Lab, Python, and R, and that's it. + tags: | + type=raw,value=python-3.11 + type=raw,value=r-4.3 + build-args: | + PYTHON_VERSION=3.11 + R_VERSION=4.3 + publish: true + + essentials: + needs: [base-r] + uses: ./.github/workflows/build-test-publish.yml + secrets: inherit + with: + image: essentials-notebook + labels: | + org.opencontainers.image.title=Essentials Notebook + org.opencontainers.image.description=CourseKata essentials: everything used in the books. + tags: | + type=raw,value=python-3.11 + type=raw,value=r-4.3 + build-args: | + BASE_IMAGE=${{ needs.base-r.outputs.image }}@${{ needs.base-r.outputs.digest}} + PARENT_IMAGE=${{ needs.base-r.outputs.image }} + publish: true + + r: + needs: [base-r, essentials] + uses: ./.github/workflows/build-test-publish.yml + secrets: inherit + with: + image: r-notebook + labels: | + org.opencontainers.image.title=R Notebook + org.opencontainers.image.description=CourseKata essentials and other R packages for teaching and learning data science. + tags: | + type=raw,value=python-3.11 + type=raw,value=r-4.3 + build-args: | + BASE_IMAGE=${{ needs.base-r.outputs.image }}@${{ needs.base-r.outputs.digest}} + PARENT_IMAGE=${{ needs.essentials.outputs.image }}@${{ needs.essentials.outputs.digest}} + publish: true + + datascience: + needs: [base-r, r] + uses: ./.github/workflows/build-test-publish.yml + secrets: inherit + with: + image: datascience-notebook + labels: | + org.opencontainers.image.title=Data Science Notebook + org.opencontainers.image.description=R and Python packages for teaching and learning data science. + tags: | + type=raw,value=python-3.11 + type=raw,value=r-4.3 + build-args: | + BASE_IMAGE=${{ needs.base-r.outputs.image }}@${{ needs.base-r.outputs.digest}} + PARENT_IMAGE=${{ needs.r.outputs.image }}@${{ needs.r.outputs.digest}} publish: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 669b4a5..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Test images - -on: - workflow_dispatch: - push: - branches: [test/*] - paths: - - .github/workflows/test.yml - - .github/workflows/build-test-publish.yml - - .github/workflows/build-test-publish-all.yml - - tests/** - - base-r-notebook/** - - essentials-notebook/** - - r-notebook/** - - datascience-notebook/** - -# https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - # only cancel in-progress jobs or runs for the current workflow - matches against branch & tags - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - uses: ./.github/workflows/build-test-publish-all.yml - secrets: inherit - with: - publish: false