Skip to content

Commit

Permalink
Refactor CI/CD to leverage and use Reusable Pipeline (#1421)
Browse files Browse the repository at this point in the history
* reusable

* Refactored CI/CD to use Reusable Pipeline

* update made

* made changes to resolve conflict and removed DeployTo_x

* change dispatch name

* typos corrected

* Added Sepolia and sepolia integration
  • Loading branch information
NetherBob authored Dec 1, 2023
1 parent fe36d16 commit 425729e
Showing 1 changed file with 28 additions and 62 deletions.
90 changes: 28 additions & 62 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,17 @@ jobs:
platforms: 'linux/amd64'
push: true
tags: nethermindeth/juno:${{ env.DOCKER_IMAGE_TAG }}


deploy_to_dev:
permissions:
id-token: write
contents: write
needs: [docker_build_and_publish]
runs-on: ubuntu-latest
environment:
name: Development
steps:
- name: Repository Dispatch Dev
env:
EVENT_NAME: juno-dev
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-dev/overlays/dev-goerli-1/config.yaml
INTEGRATION: apps/juno-dev/overlays/dev-integration/config.yaml
MAINNET: apps/juno-dev/overlays/dev-mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
uses: NethermindEth/argo/.github/workflows/TagAndDeploy.yml@juno_main
with:
environment: Development
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-dev/overlays/dev-goerli-1/config.yaml
INTEGRATION: apps/juno-dev/overlays/dev-integration/config.yaml
MAINNET: apps/juno-dev/overlays/dev-mainnet/config.yaml

dev-starknet-rs-tests:
needs: [deploy_to_dev]
Expand All @@ -85,26 +71,16 @@ jobs:

deploy_to_staging:
needs: [docker_build_and_publish, deploy_to_dev]
runs-on: ubuntu-latest
environment:
name: Staging
steps:
- name: Repository Dispatch Staging
env:
EVENT_NAME: juno-staging
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-staging/overlays/staging-goerli-1/config.yaml
INTEGRATION: apps/juno-staging/overlays/staging-integration/config.yaml
MAINNET: apps/juno-staging/overlays/staging-mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
uses: NethermindEth/argo/.github/workflows/TagAndDeploy.yml@juno_main
with:
environment: Staging
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-staging/overlays/staging-goerli-1/config.yaml
INTEGRATION: apps/juno-staging/overlays/staging-integration/config.yaml
MAINNET: apps/juno-staging/overlays/staging-mainnet/config.yaml
SEPOLIA: apps/juno-staging/overlays/staging-sepolia/config.yaml
SEPOLIA-INTEGRATION: apps/juno-staging/overlays/staging-sepolia-integration/config.yaml

staging-starknet-rs-tests:
needs: [deploy_to_staging]
uses: ./.github/workflows/starknet-rs-tests.yml
Expand All @@ -121,26 +97,16 @@ jobs:

deploy_to_production:
needs: [docker_build_and_publish, deploy_to_staging]
runs-on: ubuntu-latest
environment:
name: Production
steps:
- name: Repository Dispatch Prod
env:
EVENT_NAME: juno-prod
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-prod/overlays/prod-goerli-1/config.yaml
INTEGRATION: apps/juno-prod/overlays/prod-integration/config.yaml
MAINNET: apps/juno-prod/overlays/prod-mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
uses: NethermindEth/argo/.github/workflows/TagAndDeploy.yml@juno_main
with:
environment: Production
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-prod/overlays/prod-goerli-1/config.yaml
INTEGRATION: apps/juno-prod/overlays/prod-integration/config.yaml
MAINNET: apps/juno-prod/overlays/prod-mainnet/config.yaml
SEPOLIA: apps/juno-staging/overlays/prod-sepolia/config.yaml
SEPOLIA-INTEGRATION: apps/juno-staging/overlays/prod-sepolia-integration/config.yaml

prod-starknet-rs-tests:
needs: [deploy_to_production]
uses: ./.github/workflows/starknet-rs-tests.yml
Expand Down

0 comments on commit 425729e

Please sign in to comment.