Update CI/CD pipeline naming, image repository, and secrets var (#1919) #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD pipeline | |
env: | |
DOCKER_REGISTRY: nethermind.jfrog.io | |
REPO_DEV: nubia-docker-local-dev | |
REPO_STAGING: nubia-docker-local-staging | |
REPO_PROD: nubia-docker-local-prod | |
on: | |
push: | |
branches: [main] | |
tags: ["v*"] | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
build_docker_image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Define image tag | |
run: | | |
echo "DOCKER_IMAGE_TAG=$(git describe --tags)" >> $GITHUB_ENV | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to registry | |
run: | | |
docker login ${{ env.DOCKER_REGISTRY }} -u ${{ vars.ARTIFACTORY_ANGKOR_USER }} -p ${{ secrets.ARTIFACTORY_NUBIA_CONTRIBUTOR}} | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: "linux/amd64" | |
push: true | |
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.REPO_DEV }}/juno:${{ env.DOCKER_IMAGE_TAG }} | |
validate_dev: | |
permissions: | |
id-token: write | |
contents: write | |
needs: [build_docker_image] | |
runs-on: ubuntu-latest | |
environment: | |
name: Development | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Verify Deployment Version (Dev) | |
run: bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.DEV_SEPOLIA_URL }} ${{ env.DOCKER_IMAGE_TAG }} | |
dev-starknet-rs-tests: | |
needs: [validate_dev] | |
uses: ./.github/workflows/starknet-rs-tests.yml | |
secrets: | |
STARKNET_RPC: ${{ secrets.DEV_SEPOLIA_URL }}/v0_6 | |
dev-starknet-js-tests: | |
needs: [validate_dev] | |
uses: ./.github/workflows/starknet-js-tests.yml | |
secrets: | |
TEST_RPC_URL: ${{ secrets.DEV_SEPOLIA_URL }}/v0_7 | |
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }} | |
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} | |
promote_to_staging: | |
needs: [build_docker_image, validate_dev] | |
runs-on: ubuntu-latest | |
environment: | |
name: Staging | |
steps: | |
- name: Setup JFrog CLI | |
uses: jfrog/setup-jfrog-cli@v4 | |
env: | |
JF_URL: ${{ vars.JFROG_URL}} | |
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ANGKOR_CONTRIBUTOR }} | |
- name: Promote to Staging | |
run: | | |
jf rt dpr juno/${{ env.DOCKER_IMAGE_TAG }} ${{ env.REPO_DEV }} ${{ env.REPO_STAGING }} | |
staging-starknet-rs-tests: | |
needs: [promote_to_staging] | |
uses: ./.github/workflows/starknet-rs-tests.yml | |
secrets: | |
STARKNET_RPC: ${{ secrets.STAGING_SEPOLIA_URL }}/v0_6 | |
staging-starknet-js-tests: | |
needs: [promote_to_staging] | |
uses: ./.github/workflows/starknet-js-tests.yml | |
secrets: | |
TEST_RPC_URL: ${{ secrets.STAGING_SEPOLIA_URL }}/v0_7 | |
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }} | |
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} | |
promote_to_production: | |
needs: [build_docker_image, promote_to_staging] | |
runs-on: ubuntu-latest | |
environment: | |
name: Production | |
steps: | |
- name: Setup JFrog CLI | |
uses: jfrog/setup-jfrog-cli@v4 | |
env: | |
JF_URL: ${{ vars.JFROG_URL}} | |
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ANGKOR_CONTRIBUTOR }} | |
- name: Promote to Production | |
run: | | |
jf rt dpr juno/${{ env.DOCKER_IMAGE_TAG }} ${{ env.REPO_STAGING }} ${{ env.REPO_PROD }} | |
prod-starknet-rs-tests: | |
needs: [promote_to_production] | |
uses: ./.github/workflows/starknet-rs-tests.yml | |
secrets: | |
STARKNET_RPC: ${{ secrets.PROD_SEPOLIA_URL }}/v0_6 | |
prod-starknet-js-tests: | |
needs: [promote_to_production] | |
uses: ./.github/workflows/starknet-js-tests.yml | |
secrets: | |
TEST_RPC_URL: ${{ secrets.PROD_SEPOLIA_URL }}/v0_7 | |
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }} | |
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} |