Skip to content

Commit 30b0e5a

Browse files
committed
Update README
1 parent c42e4ec commit 30b0e5a

1 file changed

Lines changed: 37 additions & 3 deletions

File tree

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,43 @@ Add a step to your workflow that uses this action:
1313
1414
Now you can run the `replicate` CLI in subsequent steps.
1515

16-
```yaml
17-
- name: Generate a haiku
18-
run: replicate run meta/llama-2-70b-chat prompt="Write a haiku about llamas"
16+
17+
## Example: Model CI/CD
18+
19+
Here's an example that pushes a Cog model to Replicate whenever your repo's `main` branch is updated:
20+
21+
```yml
22+
name: CI
23+
24+
on:
25+
push:
26+
branches:
27+
- main
28+
29+
jobs:
30+
build:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Check out code
34+
uses: actions/checkout@v3
35+
36+
- name: Setup Cog
37+
uses: replicate/setup-cog@v1
38+
with:
39+
token: ${{ secrets.REPLICATE_API_TOKEN }}
40+
41+
- name: Setup Replicate
42+
uses: replicate/setup-replicate@main
43+
with:
44+
token: ${{ secrets.REPLICATE_API_TOKEN }}
45+
46+
- name: Push the model
47+
run: |
48+
cog push r8.im/zeke/hello-world
49+
50+
- name: Run the model
51+
run: |
52+
cog run zeke/hello-world
1953
```
2054

2155
### Inputs

0 commit comments

Comments
 (0)