mirror of
https://github.com/dagger/dagger-for-github.git
synced 2025-12-31 12:49:46 +11:00
Signed-off-by: Kyle Penfound <kyle@dagger.io> Signed-off-by: Jeremy Adams <jeremy@dagger.io> Co-authored-by: Jeremy Adams <jeremy@dagger.io>
40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
name: 'Dagger for GitHub'
|
|
description: 'Run dagger commands in Github Actions'
|
|
inputs:
|
|
version:
|
|
description: 'Dagger Version'
|
|
required: false
|
|
default: '0.9.3'
|
|
dagger-flags:
|
|
description: 'Dagger CLI Flags'
|
|
required: false
|
|
default: '-s'
|
|
verb:
|
|
description: 'CLI verb (call, download, up, functions, shell, query)'
|
|
required: false
|
|
default: 'call'
|
|
cloud-token:
|
|
description: 'Dagger Cloud Token'
|
|
required: false
|
|
default: ''
|
|
module:
|
|
description: 'Dagger module to call. Local or Git'
|
|
required: false
|
|
default: '.'
|
|
args:
|
|
description: 'Arguments to pass to CLI'
|
|
required: false
|
|
default: ''
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- run: cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ inputs.version }} sh; cd -; }
|
|
shell: bash
|
|
- run: if ! [ -d ./.git ]; then git clone -b ${GITHUB_REF_NAME} --no-checkout https://github.com/${GITHUB_REPOSITORY} .; fi
|
|
shell: bash
|
|
- run: DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} /usr/local/bin/dagger ${{ inputs.dagger-flags }} ${{ inputs.verb }} -m ${{ inputs.module }} ${{ inputs.args }}
|
|
shell: bash
|
|
- run: docker stop -t 300 $(docker ps --filter name="dagger-engine-*" -q)
|
|
shell: bash
|
|
if: ${{ always() }}
|
|
|