From 185dcd8339562867ac3ae5c658c1838f6f02498c Mon Sep 17 00:00:00 2001 From: Roy Li Date: Mon, 14 Aug 2023 20:30:41 -0400 Subject: [PATCH] Protocol ECR push workflows --- .../protocol-build-and-push-snapshot.yml | 62 +++++++++++-------- .../workflows/protocol-build-and-push.yml | 56 +++++++++-------- 2 files changed, 66 insertions(+), 52 deletions(-) rename protocol/.github/workflows/build-and-push-snapshot.yml => .github/workflows/protocol-build-and-push-snapshot.yml (86%) rename protocol/.github/workflows/build-and-push.yml => .github/workflows/protocol-build-and-push.yml (87%) diff --git a/protocol/.github/workflows/build-and-push-snapshot.yml b/.github/workflows/protocol-build-and-push-snapshot.yml similarity index 86% rename from protocol/.github/workflows/build-and-push-snapshot.yml rename to .github/workflows/protocol-build-and-push-snapshot.yml index 8ca1048077..08b37caee8 100644 --- a/protocol/.github/workflows/build-and-push-snapshot.yml +++ b/.github/workflows/protocol-build-and-push-snapshot.yml @@ -1,29 +1,32 @@ -name: Build & Push Image to AWS ECR +name: Protocol Build & Push Image to AWS ECR on: # yamllint disable-line rule:truthy + pull_request: + paths: + - 'protocol/**' push: branches: - main - - 'release/v[0-9]+.x' # e.g. release/v1.x - - 'release/[a-z]+/v[0-9]+.x' # e.g. release/ibctestnet/v1.x + - 'release/[a-z]+/v[0-9]+.[0-9]+.x' # e.g. release/ibctestnet/v1.0.x - 'release/v[0-9]+.[0-9]+.x' # e.g. release/v0.0.x jobs: build-and-push-snapshot-dev: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -49,19 +52,20 @@ jobs: build-and-push-snapshot-dev2: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV2 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV2 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV2 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV2 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -87,19 +91,20 @@ jobs: build-and-push-snapshot-dev3: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV3 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV3 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV3 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV3 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -125,19 +130,20 @@ jobs: build-and-push-snapshot-dev4: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV4 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV4 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV4 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV4 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -163,19 +169,20 @@ jobs: build-and-push-snapshot-dev5: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV5 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV5 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV5 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV5 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -201,19 +208,20 @@ jobs: build-and-push-snapshot-staging: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_STAGING }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_STAGING }} aws-region: us-east-2 - name: Login to Amazon ECR diff --git a/protocol/.github/workflows/build-and-push.yml b/.github/workflows/protocol-build-and-push.yml similarity index 87% rename from protocol/.github/workflows/build-and-push.yml rename to .github/workflows/protocol-build-and-push.yml index 30f8ef0d95..b1d4da6287 100644 --- a/protocol/.github/workflows/build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -1,4 +1,4 @@ -name: Build & Push Image to AWS ECR +name: Protocol Build & Push Image to AWS ECR on: # yamllint disable-line rule:truthy push: @@ -11,19 +11,20 @@ on: # yamllint disable-line rule:truthy jobs: build-and-push-dev: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -49,19 +50,20 @@ jobs: build-and-push-dev2: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV2 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV2 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV2 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV2 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -87,19 +89,20 @@ jobs: build-and-push-dev3: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV3 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV3 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV3 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV3 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -125,19 +128,20 @@ jobs: build-and-push-dev4: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV4 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV4 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV4 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV4 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -163,19 +167,20 @@ jobs: build-and-push-dev5: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV5 }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV5 }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_DEV5 }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_DEV5 }} aws-region: us-east-2 - name: Login to Amazon ECR @@ -201,19 +206,20 @@ jobs: build-and-push-staging: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./protocol steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: '0' # without this, ignite fails. - submodules: recursive - token: ${{ secrets.GH_REPO_READ_TOKEN }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_VALIDATOR_STAGING }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_VALIDATOR_STAGING }} aws-region: us-east-2 - name: Login to Amazon ECR