-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtar-agent.yml
More file actions
157 lines (136 loc) · 4.3 KB
/
Copy pathtar-agent.yml
File metadata and controls
157 lines (136 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Deploy Tar Agent
# This workflow demonstrates deploying an agent from a tar archive.
# You create the tar file yourself, giving you full control over packaging.
on:
workflow_dispatch:
inputs:
archive-format:
description: 'Archive format to use'
required: false
default: 'tar.gz'
type: choice
options:
- tar.gz
- tar
- tgz
push:
branches:
- main
paths:
- 'agent/**'
jobs:
deploy-tar-agent:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Example 1: Simple tar.gz creation
- name: Create tar.gz archive
run: |
# Create a tar.gz from a directory
# -c: create archive
# -z: compress with gzip
# -f: output filename
# -C: change to directory before archiving
tar -czf agent.tar.gz -C ./agent .
echo "Created agent.tar.gz ($(du -h agent.tar.gz | cut -f1))"
- name: Deploy tar.gz agent
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
agent-version: 1.0.0
path: agent.tar.gz
agent-name: my-tar-agent
setup-commands: |
chmod +x setup.sh
./setup.sh
deploy-with-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Example 2: Build process with step outputs
- name: Build and package agent
id: build
run: |
# Your custom build process
echo "Building agent..."
mkdir -p dist
# Example: compile, minify, or prepare files
cp -r src/* dist/
# Create tar archive
cd dist
tar -czf ../my-agent.tar.gz .
cd ..
# Output the path for next step
echo "archive-path=my-agent.tar.gz" >> $GITHUB_OUTPUT
echo "agent-version=v$(date +%Y%m%d-%H%M%S)" >> $GITHUB_OUTPUT
- name: Deploy built agent
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
agent-version: ${{ steps.build.outputs.agent-version }}
path: ${{ steps.build.outputs.archive-path }}
agent-name: built-agent-${{ steps.build.outputs.agent-version }}
deploy-uncompressed-tar:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Example 3: Uncompressed .tar format
- name: Create uncompressed tar
run: |
# Create a .tar without compression (useful for already-compressed files)
tar -cf agent.tar -C ./agent .
- name: Deploy tar agent
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
agent-version: 1.0.0
path: agent.tar
deploy-with-exclusions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Example 4: Custom tar with exclusions
- name: Create tar with exclusions
run: |
# Create tar excluding certain files/directories
tar -czf agent.tar.gz \
-C ./agent \
--exclude='*.log' \
--exclude='node_modules' \
--exclude='.git' \
--exclude='__pycache__' \
--exclude='*.pyc' \
.
- name: Deploy agent
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
agent-version: 1.0.0
path: agent.tar.gz
object-ttl-days: 30
deploy-from-artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Example 5: Using artifacts from a previous job/workflow
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: agent-package
path: ./artifacts
- name: Deploy from artifact
uses: runloopai/deploy-agent@main
with:
api-key: ${{ secrets.RUNLOOP_API_KEY }}
source-type: tar
agent-version: 1.0.0
path: ./artifacts/agent.tar.gz