Skip to content

Commit bdf6590

Browse files
authored
Add image push action to CI (#41)
1 parent 84be9bf commit bdf6590

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/image-push.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Push Pyth Agent Image
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
workflow_dispatch:
7+
inputs:
8+
dispatch_description:
9+
description: "Dispatch description"
10+
required: true
11+
type: string
12+
jobs:
13+
agent-push-image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write
17+
contents: read
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
21+
with:
22+
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
23+
aws-region: eu-west-2
24+
- uses: docker/login-action@v2
25+
with:
26+
registry: public.ecr.aws
27+
env:
28+
AWS_REGION: us-east-1
29+
- run: docker context create builders
30+
- uses: docker/setup-buildx-action@v2
31+
with:
32+
version: latest
33+
endpoint: builders
34+
- uses: haya14busa/action-cond@v1
35+
id: image_tag
36+
with:
37+
cond: ${{ startsWith(github.ref, 'refs/tags/') }}
38+
if_true: ${{ github.ref_name }}
39+
if_false: ${{ github.sha }}
40+
- uses: docker/build-push-action@v2
41+
with:
42+
push: true
43+
tags: public.ecr.aws/pyth-network/agent:${{ steps.image_tag.outputs.value }}

0 commit comments

Comments
 (0)