Skip to content

Commit

Permalink
extended deploy workflow with configurable parameter tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
mtitov committed Dec 26, 2024
1 parent 64e0b6a commit 51e99f6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
docker load --input /tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
docker image ls -a
- name: Run tutorials
timeout-minutes: 15
timeout-minutes: 20
run: |
docker run ${{ env.TUTORIAL_TAG }} bash -c "\
jupyter nbconvert --clear-output --inplace ${{ env.TARGET_PATH }} && \
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ on:
required: true
DOCKERHUB_TOKEN:
required: true
inputs:
tutorial:
description: 'Tutorial name and tag'
default: 'latest'
type: string
required: false

jobs:
deploy:
name: Push docker image
runs-on: ubuntu-latest
env:
TUTORIAL_TAG: radicalcybertools/tutorials:latest
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -27,13 +31,22 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: set env
run: |-
echo "TUTORIAL_NAME=$(
if [[ ${{ github.event_name }} == repository_dispatch ]]; then
echo ${{ github.event.client_payload.tutorial || 'latest' }}
elif [[ ${{ github.event_name }} == workflow_call ]]; then
echo ${{ inputs.tutorial }}
fi
)" >> $GITHUB_ENV
- uses: docker/build-push-action@v6
with:
context: ./src/
file: ./docker/Dockerfile
build-args: |
TUTORIAL_NAME=latest
TUTORIAL_NAME=${{ env.TUTORIAL_NAME }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.TUTORIAL_TAG }}
tags: radicalcybertools/tutorials:${{ env.TUTORIAL_NAME }}

0 comments on commit 51e99f6

Please sign in to comment.