File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Price Pusher Image
2+ on :
3+ push :
4+ tags :
5+ - pyth-price-pusher-v*
6+ workflow_dispatch :
7+ inputs :
8+ dispatch_description :
9+ description : " Dispatch description"
10+ required : true
11+ type : string
12+ permissions :
13+ contents : read
14+ id-token : write
15+ jobs :
16+ price-pusher-image :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v2
20+ - name : Set image tag to version of the git tag
21+ if : ${{ startsWith(github.ref, 'refs/tags/pyth-price-pusher-v') }}
22+ run : |
23+ PREFIX="refs/tags/pyth-price-pusher-"
24+ VERSION="${GITHUB_REF:${#PREFIX}}"
25+ echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
26+ - name : Set image tag to the git commit hash
27+ if : ${{ !startsWith(github.ref, 'refs/tags/pyth-price-pusher-v') }}
28+ run : |
29+ echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
30+ - uses : aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
31+ with :
32+ role-to-assume : arn:aws:iam::192824654885:role/github-actions-ecr
33+ aws-region : eu-west-2
34+ - uses : docker/login-action@v2
35+ with :
36+ registry : public.ecr.aws
37+ env :
38+ AWS_REGION : us-east-1
39+ - uses : aws-actions/amazon-ecr-login@v1
40+ id : ecr_login
41+ - run : |
42+ cd price_pusher
43+ DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
44+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
45+ env:
46+ ECR_REGISTRY: public.ecr.aws
47+ ECR_REPOSITORY: pyth-network/xc-price-pusher
You can’t perform that action at this time.
0 commit comments