From 82c77065324da5cdf2159ede94feef06d633c354 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 24 Jun 2025 17:05:46 +0100 Subject: [PATCH 1/6] fix: chmod the script so it executes correctly, maybe --- .github/workflows/deploy_switch_ensnode_environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_switch_ensnode_environment.yml b/.github/workflows/deploy_switch_ensnode_environment.yml index 09770e412..1d7674d9e 100644 --- a/.github/workflows/deploy_switch_ensnode_environment.yml +++ b/.github/workflows/deploy_switch_ensnode_environment.yml @@ -51,6 +51,7 @@ jobs: - name: Promote ENSAdmin Deployment run: | + chmod +x ./.github/scripts/promote_ensadmin.sh ./.github/scripts/promote_ensadmin.sh - name: Switch Traefik routers From 1fa259bf6748e09667cd217ff1158e6ab54128ae Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 24 Jun 2025 17:08:04 +0100 Subject: [PATCH 2/6] fix: try with ghcr login --- .github/workflows/deploy_switch_ensnode_environment.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_switch_ensnode_environment.yml b/.github/workflows/deploy_switch_ensnode_environment.yml index 1d7674d9e..367fce792 100644 --- a/.github/workflows/deploy_switch_ensnode_environment.yml +++ b/.github/workflows/deploy_switch_ensnode_environment.yml @@ -26,6 +26,13 @@ jobs: with: fetch-depth: 1 + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Print switch target run: | echo "Switching to: $TARGET_ENVIRONMENT" @@ -51,7 +58,6 @@ jobs: - name: Promote ENSAdmin Deployment run: | - chmod +x ./.github/scripts/promote_ensadmin.sh ./.github/scripts/promote_ensadmin.sh - name: Switch Traefik routers From e249f53a7a8eb37cdff96471a7a956acfaa35564 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 24 Jun 2025 17:15:53 +0100 Subject: [PATCH 3/6] add setup skopeo --- .../workflows/deploy_switch_ensnode_environment.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_switch_ensnode_environment.yml b/.github/workflows/deploy_switch_ensnode_environment.yml index 367fce792..f8f6a1cf7 100644 --- a/.github/workflows/deploy_switch_ensnode_environment.yml +++ b/.github/workflows/deploy_switch_ensnode_environment.yml @@ -33,6 +33,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: 'Set up skopeo' + uses: warjiang/setup-skopeo@main + with: + version: latest + - name: Print switch target run: | echo "Switching to: $TARGET_ENVIRONMENT" @@ -41,15 +46,15 @@ jobs: run: | case "$TARGET_ENVIRONMENT" in "green") - echo "SLACK_TITLE=':large_green_circle: GREEN Environment Activated" >> "$GITHUB_ENV" + echo "SLACK_TITLE=:large_green_circle: GREEN Environment Activated" >> "$GITHUB_ENV" echo "RAILWAY_ENVIRONMENT_ID=${{ secrets.GREEN_RAILWAY_ENVIRONMENT_ID }}" >> $GITHUB_ENV ;; "blue") - echo "SLACK_TITLE=':large_blue_circle: BLUE Environment Activated" >> "$GITHUB_ENV" + echo "SLACK_TITLE=:large_blue_circle: BLUE Environment Activated" >> "$GITHUB_ENV" echo "RAILWAY_ENVIRONMENT_ID=${{ secrets.BLUE_RAILWAY_ENVIRONMENT_ID }}" >> $GITHUB_ENV ;; *) - echo "SLACK_TITLE=':large_red_circle: Unrecognized environment activated" >> "$GITHUB_ENV" + echo "SLACK_TITLE=:large_red_circle: Unrecognized Environment Activated" >> "$GITHUB_ENV" esac - name: Install redis-cli @@ -58,6 +63,7 @@ jobs: - name: Promote ENSAdmin Deployment run: | + chmod +x ./.github/scripts/promote_ensadmin.sh ./.github/scripts/promote_ensadmin.sh - name: Switch Traefik routers From c9ede4a141693d2c30c424bf4f5d1d1b9b3ebb19 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 24 Jun 2025 17:18:23 +0100 Subject: [PATCH 4/6] asdf --- .../deploy_switch_ensnode_environment.yml | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy_switch_ensnode_environment.yml b/.github/workflows/deploy_switch_ensnode_environment.yml index f8f6a1cf7..f21f531ff 100644 --- a/.github/workflows/deploy_switch_ensnode_environment.yml +++ b/.github/workflows/deploy_switch_ensnode_environment.yml @@ -13,7 +13,7 @@ on: jobs: switch-environment: - runs-on: blacksmith-4vcpu-ubuntu-2204 + runs-on: ubuntu-latest env: TARGET_ENVIRONMENT: ${{ inputs.target }} REDIS_URL: ${{ secrets.TRAEFIK_REDIS_URL }} @@ -26,6 +26,10 @@ jobs: with: fetch-depth: 1 + - name: Print switch target + run: | + echo "Switching to: $TARGET_ENVIRONMENT" + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -33,15 +37,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: 'Set up skopeo' - uses: warjiang/setup-skopeo@main - with: - version: latest - - - name: Print switch target - run: | - echo "Switching to: $TARGET_ENVIRONMENT" - - name: Calculate env variables run: | case "$TARGET_ENVIRONMENT" in @@ -57,10 +52,6 @@ jobs: echo "SLACK_TITLE=:large_red_circle: Unrecognized Environment Activated" >> "$GITHUB_ENV" esac - - name: Install redis-cli - run: | - sudo apt install redis-tools - - name: Promote ENSAdmin Deployment run: | chmod +x ./.github/scripts/promote_ensadmin.sh @@ -68,9 +59,7 @@ jobs: - name: Switch Traefik routers run: | - # SEPOLIA - redis-cli -u $REDIS_URL SET traefik/http/routers/sepolia-api-router/service "${TARGET_ENVIRONMENT}-sepolia-api" - redis-cli -u $REDIS_URL SET traefik/http/routers/sepolia-indexer-router/service "${TARGET_ENVIRONMENT}-sepolia-indexer" + sudo apt install redis-tools # ALPHA redis-cli -u $REDIS_URL SET traefik/http/routers/alpha-api-router/service "${TARGET_ENVIRONMENT}-alpha-api" @@ -80,6 +69,10 @@ jobs: redis-cli -u $REDIS_URL SET traefik/http/routers/mainnet-api-router/service "${TARGET_ENVIRONMENT}-mainnet-api" redis-cli -u $REDIS_URL SET traefik/http/routers/mainnet-indexer-router/service "${TARGET_ENVIRONMENT}-mainnet-indexer" + # SEPOLIA + redis-cli -u $REDIS_URL SET traefik/http/routers/sepolia-api-router/service "${TARGET_ENVIRONMENT}-sepolia-api" + redis-cli -u $REDIS_URL SET traefik/http/routers/sepolia-indexer-router/service "${TARGET_ENVIRONMENT}-sepolia-indexer" + # HOLESKY redis-cli -u $REDIS_URL SET traefik/http/routers/holesky-api-router/service "${TARGET_ENVIRONMENT}-holesky-api" redis-cli -u $REDIS_URL SET traefik/http/routers/holesky-indexer-router/service "${TARGET_ENVIRONMENT}-holesky-indexer" From 4d7969a0da73bdc489a0a2f8f37b955357fd79a2 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 24 Jun 2025 17:20:36 +0100 Subject: [PATCH 5/6] try without login --- .../workflows/deploy_switch_ensnode_environment.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_switch_ensnode_environment.yml b/.github/workflows/deploy_switch_ensnode_environment.yml index f21f531ff..73db031bc 100644 --- a/.github/workflows/deploy_switch_ensnode_environment.yml +++ b/.github/workflows/deploy_switch_ensnode_environment.yml @@ -13,6 +13,7 @@ on: jobs: switch-environment: + # NOTE: this needs to run on GH runner because of some obscure skopeo permissions thing runs-on: ubuntu-latest env: TARGET_ENVIRONMENT: ${{ inputs.target }} @@ -30,12 +31,12 @@ jobs: run: | echo "Switching to: $TARGET_ENVIRONMENT" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} - name: Calculate env variables run: | From e5b12e1eaf29e16825e38a4c2414e5f023a58325 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 24 Jun 2025 17:23:26 +0100 Subject: [PATCH 6/6] tidy --- .../deploy_switch_ensnode_environment.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy_switch_ensnode_environment.yml b/.github/workflows/deploy_switch_ensnode_environment.yml index 73db031bc..00c196c7f 100644 --- a/.github/workflows/deploy_switch_ensnode_environment.yml +++ b/.github/workflows/deploy_switch_ensnode_environment.yml @@ -15,6 +15,7 @@ jobs: switch-environment: # NOTE: this needs to run on GH runner because of some obscure skopeo permissions thing runs-on: ubuntu-latest + name: Switch Environment to ${{ inputs.target }} env: TARGET_ENVIRONMENT: ${{ inputs.target }} REDIS_URL: ${{ secrets.TRAEFIK_REDIS_URL }} @@ -27,17 +28,6 @@ jobs: with: fetch-depth: 1 - - name: Print switch target - run: | - echo "Switching to: $TARGET_ENVIRONMENT" - - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - - name: Calculate env variables run: | case "$TARGET_ENVIRONMENT" in @@ -53,12 +43,12 @@ jobs: echo "SLACK_TITLE=:large_red_circle: Unrecognized Environment Activated" >> "$GITHUB_ENV" esac - - name: Promote ENSAdmin Deployment + - name: Promote ENSAdmin Vercel Deployment run: | chmod +x ./.github/scripts/promote_ensadmin.sh ./.github/scripts/promote_ensadmin.sh - - name: Switch Traefik routers + - name: Switch Traefik Routing run: | sudo apt install redis-tools @@ -81,7 +71,8 @@ jobs: # ENSRAINBOW redis-cli -u $REDIS_URL SET traefik/http/routers/ensrainbow-api-router/service "${TARGET_ENVIRONMENT}-ensrainbow-api" - - uses: ./.github/actions/send_slack_notification + - name: Send Slack Notification + uses: ./.github/actions/send_slack_notification with: slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} slack_title: ${{ env.SLACK_TITLE }}