Skip to content

deploy-on-demand

deploy-on-demand #7

Workflow file for this run

name: Deploy RADICAL-Tutorials container
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
# https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event
repository_dispatch:
types: [ deploy-on-demand ]
workflow_call:
secrets:
DOCKERHUB_USERNAME:
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
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
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=${{ env.TUTORIAL_NAME }}
platforms: linux/amd64,linux/arm64
push: true
tags: radicalcybertools/tutorials:${{ env.TUTORIAL_NAME }}