mirror of
https://github.com/dagger/dagger-for-github.git
synced 2026-01-02 13:20:11 +11:00
Add support for dagger run and workdir
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
This commit is contained in:
parent
ea1e4f41f5
commit
106340bff2
1 changed files with 24 additions and 6 deletions
30
action.yml
30
action.yml
|
|
@ -8,11 +8,15 @@ inputs:
|
||||||
dagger-flags:
|
dagger-flags:
|
||||||
description: 'Dagger CLI Flags'
|
description: 'Dagger CLI Flags'
|
||||||
required: false
|
required: false
|
||||||
default: '-s'
|
default: '--progress plain'
|
||||||
verb:
|
verb:
|
||||||
description: 'CLI verb (call, download, up, functions, shell, query)'
|
description: 'CLI verb (call, run, download, up, functions, shell, query)'
|
||||||
required: false
|
required: false
|
||||||
default: 'call'
|
default: 'call'
|
||||||
|
workdir:
|
||||||
|
description: 'The working directory in which to run the Dagger CLI'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
cloud-token:
|
cloud-token:
|
||||||
description: 'Dagger Cloud Token'
|
description: 'Dagger Cloud Token'
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -20,7 +24,7 @@ inputs:
|
||||||
module:
|
module:
|
||||||
description: 'Dagger module to call. Local or Git'
|
description: 'Dagger module to call. Local or Git'
|
||||||
required: false
|
required: false
|
||||||
default: '.'
|
default: ''
|
||||||
args:
|
args:
|
||||||
description: 'Arguments to pass to CLI'
|
description: 'Arguments to pass to CLI'
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -28,13 +32,27 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ inputs.version }} sh; cd -; }
|
- run: |
|
||||||
|
cd /usr/local && { \
|
||||||
|
curl -sL https://dl.dagger.io/dagger/install.sh 2>/dev/null | \
|
||||||
|
DAGGER_VERSION=${{ inputs.version }} sh 2>/dev/null; }
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- run: if ! [ -d ./.git ]; then git clone -b ${GITHUB_REF_NAME} --no-checkout https://github.com/${GITHUB_REPOSITORY} .; fi
|
- run: if ! [ -d ./.git ]; then git clone -b ${GITHUB_REF_NAME} --no-checkout https://github.com/${GITHUB_REPOSITORY} .; fi
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} /usr/local/bin/dagger ${{ inputs.dagger-flags }} ${{ inputs.verb }} -m ${{ inputs.module }} ${{ inputs.args }}
|
|
||||||
|
- run: |
|
||||||
|
cd ${{ inputs.workdir }} && { \
|
||||||
|
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
|
||||||
|
/usr/local/bin/dagger \
|
||||||
|
${{ inputs.dagger-flags }} \
|
||||||
|
${{ inputs.verb }} \
|
||||||
|
${INPUT_MODULE:+-m $INPUT_MODULE} \
|
||||||
|
${{ inputs.args }}; }
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
INPUT_MODULE: ${{ inputs.module }}
|
||||||
|
|
||||||
- run: docker stop -t 300 $(docker ps --filter name="dagger-engine-*" -q)
|
- run: docker stop -t 300 $(docker ps --filter name="dagger-engine-*" -q)
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue