|
| 1 | +name: Solana validator build / push image |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + artifact_download_url: |
| 6 | + type: string |
| 7 | + description: The url for the chainlink-ccip artifacts |
| 8 | + required: true |
| 9 | + artifacts_sha: |
| 10 | + type: string |
| 11 | + description: The solana programs sha |
| 12 | + required: true |
| 13 | +env: |
| 14 | + REGISTRY_ALIAS: w0i8p0z9 |
| 15 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 16 | +permissions: |
| 17 | + id-token: write |
| 18 | + contents: read |
| 19 | + |
| 20 | +jobs: |
| 21 | + build-amd64: |
| 22 | + name: Build & Push AMD64 Image |
| 23 | + runs-on: ubuntu-latest # Ensure it supports x86_64 |
| 24 | + environment: ecr-prod-publish |
| 25 | + steps: |
| 26 | + - name: Checkout Code |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Configure AWS Credentials |
| 30 | + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 |
| 31 | + with: |
| 32 | + aws-region: us-east-1 |
| 33 | + role-to-assume: ${{ secrets.AWS_OIDC_PUBLISH_ECR_ROLE_ARN }} |
| 34 | + |
| 35 | + - name: Login to Amazon ECR |
| 36 | + id: login-ecr |
| 37 | + uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 |
| 38 | + with: |
| 39 | + registry-type: 'public' |
| 40 | + registries: ${{ secrets.AWS_PROD_ACCOUNT_NUMBER }} |
| 41 | + |
| 42 | + - name: Set up Docker Buildx |
| 43 | + uses: docker/setup-buildx-action@v3 |
| 44 | + |
| 45 | + - name: Download CCIP artifacts |
| 46 | + run: | |
| 47 | + curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN}}" -o artifact.zip ${{ inputs.ARTIFACT_DOWNLOAD_URL }} |
| 48 | + unzip artifact.zip -d /home/runner/work/chainlink-testing-framework/images/solana-validator/solana_artifacts |
| 49 | +
|
| 50 | + - name: Build and Push AMD64 Image |
| 51 | + uses: docker/build-push-action@v5 |
| 52 | + with: |
| 53 | + context: ./images/solana-validator/ |
| 54 | + file: ./images/solana-validator/Dockerfile |
| 55 | + push: true |
| 56 | + platforms: linux/amd64 |
| 57 | + tags: | |
| 58 | + ${{ steps.login-ecr.outputs.registry }}/${{ env.REGISTRY_ALIAS }}/solana-validator:sha-${{ inputs.artifacts_sha }}-amd64 |
| 59 | + cache-from: type=gha |
| 60 | + cache-to: type=gha,mode=max |
| 61 | + |
| 62 | + build-arm64: |
| 63 | + name: Build & Push Arm64 Image |
| 64 | + runs-on: ubuntu-24.04-arm # Ensure it supports x86_64 |
| 65 | + environment: ecr-prod-publish |
| 66 | + steps: |
| 67 | + - name: Checkout Code |
| 68 | + uses: actions/checkout@v4 |
| 69 | + |
| 70 | + - name: Configure AWS Credentials |
| 71 | + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 |
| 72 | + with: |
| 73 | + aws-region: us-east-1 |
| 74 | + role-to-assume: ${{ secrets.AWS_OIDC_PUBLISH_ECR_ROLE_ARN }} |
| 75 | + |
| 76 | + - name: Login to Amazon ECR |
| 77 | + id: login-ecr |
| 78 | + uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 |
| 79 | + with: |
| 80 | + registry-type: 'public' |
| 81 | + registries: ${{ secrets.AWS_PROD_ACCOUNT_NUMBER }} |
| 82 | + |
| 83 | + - name: Set up Docker Buildx |
| 84 | + uses: docker/setup-buildx-action@v3 |
| 85 | + |
| 86 | + - name: Download CCIP artifacts |
| 87 | + run: | |
| 88 | + curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN}}" -o artifact.zip ${{ inputs.ARTIFACT_DOWNLOAD_URL }} |
| 89 | + unzip artifact.zip -d /home/runner/work/chainlink-testing-framework/images/solana-validator/solana_artifacts |
| 90 | +
|
| 91 | + - name: Build and Push Arm64 Image |
| 92 | + uses: docker/build-push-action@v5 |
| 93 | + with: |
| 94 | + context: ./images/solana-validator/ |
| 95 | + file: ./images/solana-validator/Dockerfile |
| 96 | + push: true |
| 97 | + platforms: linux/arm64 |
| 98 | + tags: | |
| 99 | + ${{ steps.login-ecr.outputs.registry }}/${{ env.REGISTRY_ALIAS }}/solana-validator:sha-${{ inputs.artifacts_sha }}-arm64 |
| 100 | + cache-from: type=gha |
| 101 | + cache-to: type=gha,mode=max |
0 commit comments