59 lines
3.0 KiB
YAML
59 lines
3.0 KiB
YAML
name: 'Speckle Automate Function - Build and Publish'
|
|
description: 'Builds and publishes a new version of a Speckle Automate Function to the Speckle Automate platform.'
|
|
author: 'specklesystems'
|
|
branding:
|
|
icon: 'upload-cloud'
|
|
color: 'blue'
|
|
inputs:
|
|
speckle_automate_url:
|
|
description: 'Speckle Automate URL. Should include the `https://` protocol and not end with a trailing slash.'
|
|
required: false
|
|
default: 'https://automate.speckle.dev' #TODO change to https://automate.speckle.systems
|
|
speckle_token:
|
|
description: 'Token for authentication to Speckle Automate Server, allowing publishing of Speckle Functions. **The token must be stored in GitHub as an encrypted secret**.'
|
|
required: true
|
|
speckle_function_id:
|
|
description: 'The unique identifier of the function. Go to Speckle Automate to register your Function and get its Identifier.'
|
|
required: true
|
|
speckle_function_input_schema:
|
|
description: 'JSON Schema defining the parameters required by the Function. These will be used to create the User Interface displayed to users of your Function in Speckle Automate. Users will be able to provide their data to customise the Function.'
|
|
required: false
|
|
default: './input-schema.json'
|
|
speckle_function_command:
|
|
description: 'The command to run to execute the function in a runtime environment.'
|
|
required: true
|
|
dockerfile_path:
|
|
description: 'Path to the Dockerfile to be used to build the Speckle Function.'
|
|
required: false
|
|
default: './Dockerfile'
|
|
docker_context:
|
|
description: 'Path to the directory containing the build context for the Docker image.'
|
|
required: false
|
|
default: '.' # root directory of the checked out source code
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- uses: actions/checkout@v3.5.3 # checkout the repository in which this GitHub Action is being used.
|
|
- name: Speckle Automate function version publisher
|
|
uses: specklesystems/speckle-automate-github-action@0.1.1
|
|
with:
|
|
speckle_automate_url: ${{ inputs.speckle_automate_url }}
|
|
speckle_token: ${{ inputs.speckle_token }}
|
|
speckle_function_id: ${{ inputs.speckle_function_id }}
|
|
speckle_function_input_schema: ${{ inputs.speckle_function_input_schema }}
|
|
speckle_function_command: ${{ inputs.speckle_function_command }}
|
|
- name: Log in to Speckle Automate Docker registry
|
|
uses: docker/login-action@v2.2.0
|
|
with:
|
|
registry: ${{ inputs.speckle_automate_url }}
|
|
username: ${{ inputs.speckle_token }}
|
|
password: ${{ inputs.speckle_token }}
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v4.1.1
|
|
with:
|
|
context: ${{ inputs.docker_context }}
|
|
file: ${{ inputs.dockerfile_path }}
|
|
tags: ${{ steps.register-speckle-function-version.outputs.speckle_automate_host }}/${{ inputs.speckle_function_id }}:${{ steps.register-speckle-function-version.outputs.version_id }}
|
|
target: ''
|
|
push: true
|