From 9e7cb172f9dd49f487b940f1a33a6eed7d5faaf0 Mon Sep 17 00:00:00 2001 From: shpookas Date: Thu, 29 Jan 2026 12:02:18 +0000 Subject: [PATCH 1/2] fair value aws --- .github/workflows/pr-pipeline.yml | 100 ++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/pr-pipeline.yml diff --git a/.github/workflows/pr-pipeline.yml b/.github/workflows/pr-pipeline.yml new file mode 100644 index 0000000..70e2238 --- /dev/null +++ b/.github/workflows/pr-pipeline.yml @@ -0,0 +1,100 @@ +name: fair-value-pull-request-pipeline + +on: + pull_request: + branches: + - master + paths-ignore: + - '**.md' + - '.gitignore' + workflow_dispatch: + +permissions: + contents: read + packages: write + +env: + ACTIONS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }} + +jobs: + push_image_and_deploy: + runs-on: ubuntu-latest + environment: + name: dia-testspace + steps: + - uses: actions/checkout@v4 + + - name: Get Short Commit Hash + run: | + COMMIT_HASH=$(git rev-parse --short HEAD) + echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV + + - name: Checkout lumina-infra repository + env: + LUMINA_INFRA_PAT: ${{ secrets.LUMINA_INFRA_PAT }} + run: | + rm -rf lumina-infra + git clone -q https://$LUMINA_INFRA_PAT@github.com/diadata-org/lumina-infra lumina-infra + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and push to AWS ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + IMAGE_TAG: commit-hash-${{ env.COMMIT_HASH }} + run: | + docker build -f build/Dockerfile -t ${ECR_REGISTRY}/lumina/fair-value:${IMAGE_TAG} . + docker push ${ECR_REGISTRY}/lumina/fair-value:${IMAGE_TAG} + echo "✅ Pushed image to AWS ECR:" + echo " ${ECR_REGISTRY}/lumina/fair-value:${IMAGE_TAG}" + + - name: Update AWS testnet feeder values and push to lumina-infra + env: + LUMINA_INFRA_PAT: ${{ secrets.LUMINA_INFRA_PAT }} + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + run: | + cd lumina-infra + + git config user.name "DIA Lumina Bot" + git config user.email "infrastructure@diadata.org" + + # Update image registry and tag for fair-value feeders + FEEDERS="301-fair-value-feeder-testnet-aws 302-fair-value-feeder-testnet-aws 303-fair-value-feeder-testnet-aws 304-fair-value-feeder-testnet-aws 305-fair-value-feeder-testnet-aws" + for feeder in $FEEDERS; do + VALUES_FILE="helmcharts/fair-value-feeders-aws/${feeder}/values.yaml" + if [ -f "$VALUES_FILE" ]; then + echo "Updating $VALUES_FILE" + sed -i "s|image: [^,]*|image: ${ECR_REGISTRY}/lumina/fair-value|" "$VALUES_FILE" + sed -i "s|tag: [^}]*|tag: commit-hash-${{ env.COMMIT_HASH }}|" "$VALUES_FILE" + fi + done + + echo "Changes to be committed:" + git diff helmcharts/fair-value-feeders-aws/*/values.yaml + + if ! git diff --quiet; then + git add helmcharts/fair-value-feeders-aws/*/values.yaml + git commit -m "PR #${{ github.event.pull_request.number }}: Update fair-value feeders to commit-hash-${{ env.COMMIT_HASH }}" + git push https://$LUMINA_INFRA_PAT@github.com/diadata-org/lumina-infra.git HEAD:master + echo "✅ Pushed updates to lumina-infra. ArgoCD will sync fair-value feeders automatically." + else + echo "ℹ️ No changes to commit" + fi + + cd .. + + - name: Cleanup cloned repository + run: | + rm -rf lumina-infra From 479719a71854fb68f013e4fb32577a1cc8cdab1c Mon Sep 17 00:00:00 2001 From: shpookas Date: Thu, 29 Jan 2026 12:04:22 +0000 Subject: [PATCH 2/2] fair value aws --- .github/workflows/pr-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-pipeline.yml b/.github/workflows/pr-pipeline.yml index 70e2238..9233d6c 100644 --- a/.github/workflows/pr-pipeline.yml +++ b/.github/workflows/pr-pipeline.yml @@ -57,7 +57,7 @@ jobs: run: | docker build -f build/Dockerfile -t ${ECR_REGISTRY}/lumina/fair-value:${IMAGE_TAG} . docker push ${ECR_REGISTRY}/lumina/fair-value:${IMAGE_TAG} - echo "✅ Pushed image to AWS ECR:" + echo "Pushed image to AWS ECR:" echo " ${ECR_REGISTRY}/lumina/fair-value:${IMAGE_TAG}" - name: Update AWS testnet feeder values and push to lumina-infra @@ -88,9 +88,9 @@ jobs: git add helmcharts/fair-value-feeders-aws/*/values.yaml git commit -m "PR #${{ github.event.pull_request.number }}: Update fair-value feeders to commit-hash-${{ env.COMMIT_HASH }}" git push https://$LUMINA_INFRA_PAT@github.com/diadata-org/lumina-infra.git HEAD:master - echo "✅ Pushed updates to lumina-infra. ArgoCD will sync fair-value feeders automatically." + echo "Pushed updates to lumina-infra. ArgoCD will sync fair-value feeders automatically." else - echo "ℹ️ No changes to commit" + echo "No changes to commit" fi cd ..