Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Mark dist folder as generated
dist/** linguist-generated=true
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A GitHub Action to deploy agents to the [Runloop](https://runloop.ai) platform.

```yaml
- name: Deploy agent
uses: runloop/deploy-agent@v1
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: git
Expand Down Expand Up @@ -59,7 +59,7 @@ That's it! The action will automatically use your current repository and commit

```yaml
- uses: actions/checkout@v4
- uses: runloop/deploy-agent@v1
- uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: git
Expand All @@ -80,7 +80,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: runloop/deploy-agent@v1
- uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: git
Expand All @@ -101,7 +101,7 @@ Basic example:

# Then deploy it
- name: Deploy agent
uses: runloop/deploy-agent@v1
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
Expand All @@ -119,7 +119,7 @@ You can also use `.tar` format or reference output from a previous step:
make package
echo "archive-path=dist/my-agent.tar.gz" >> $GITHUB_OUTPUT

- uses: runloop/deploy-agent@v1
- uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
Expand All @@ -129,7 +129,7 @@ You can also use `.tar` format or reference output from a previous step:
### Single File

```yaml
- uses: runloop/deploy-agent@v1
- uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: file
Expand Down Expand Up @@ -158,13 +158,25 @@ Store your Runloop API key as a GitHub secret:
pnpm install
```

### Testing with act

You can test the action locally using [act](https://github.com/nektos/act):

```bash
act -j deploy --secret RUNLOOP_API_KEY=your_api_key
```

### Building

The action uses [@vercel/ncc](https://github.com/vercel/ncc) to bundle all dependencies into a single file.

```bash
pnpm run build # Build TypeScript
pnpm run build # Bundle with ncc (creates dist/index.js)
pnpm run rebuild # Clean and build
```

After building, commit the `dist/` folder as it's required for the action to run.

### Code Quality

```bash
Expand Down
46 changes: 2 additions & 44 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,55 +56,13 @@ inputs:
outputs:
agent-id:
description: 'The ID of the created agent (e.g., agt_xxxx)'
value: ${{ steps.deploy-agent.outputs.agent-id }}

object-id:
description: 'The ID of the uploaded object (if applicable, e.g., obj_xxxx)'
value: ${{ steps.deploy-agent.outputs.object-id }}

agent-name:
description: 'The final name of the created agent'
value: ${{ steps.deploy-agent.outputs.agent-name }}

runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Install dependencies
shell: bash
run: |
cd ${{ github.action_path }}
pnpm install --prod --frozen-lockfile

- name: Deploy agent
id: deploy-agent
shell: bash
env:
INPUT_API_KEY: ${{ inputs.api-key }}
INPUT_SOURCE_TYPE: ${{ inputs.source-type }}
INPUT_AGENT_NAME: ${{ inputs.agent-name }}
INPUT_GIT_REPOSITORY: ${{ inputs.git-repository }}
INPUT_GIT_REF: ${{ inputs.git-ref }}
INPUT_PATH: ${{ inputs.path }}
INPUT_SETUP_COMMANDS: ${{ inputs.setup-commands }}
INPUT_IS_PUBLIC: ${{ inputs.is-public }}
INPUT_API_URL: ${{ inputs.api-url }}
INPUT_OBJECT_TTL_DAYS: ${{ inputs.object-ttl-days }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |
cd ${{ github.action_path }}
node dist/index.js
using: 'node20'
main: 'dist/index.js'
Loading