Skip to content

Commit

Permalink
Trigger to test
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciechos committed Oct 1, 2023
1 parent 1207458 commit 58c5955
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 99 deletions.
52 changes: 37 additions & 15 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,53 @@ name: CI/CD

on:
push:
branches: [main]
branches: [main, wojciechos/cleanup-ci]
tags: [v*]

jobs:
docker_build_and_publish_amd:
docker_build_and_publish:
runs-on: ubuntu-latest
outputs:
IMAGE_TAG: ${{ steps.image_tag.outputs.IMAGE_TAG }}
steps:
- name: Call AMD Build Workflow
id: amd_build
uses: ./.github/workflows/docker-build-publish-amd.yml
- name: Checkout
uses: actions/checkout@v4
with:
tag: ${{ github.ref }}
outputs:
AMD_IMAGE_TAG: ${{ steps.amd_build.outputs.AMD_IMAGE_TAG }}
fetch-depth: 0

- name: Define_docker_image_tag
id: image_tag
run: |
echo "DOCKER_IMAGE_TAG=$(git describe --tags)" >> $GITHUB_ENV
echo "IMAGE_TAG=$(git describe --tags)" >> "$GITHUB_OUTPUT"
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
platforms: 'linux/amd64'
push: true
tags: nethermindeth/juno:${{ env.DOCKER_IMAGE_TAG }}

deploy_to_dev:
needs: [docker_build_and_publish_amd]
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_amd.outputs.AMD_IMAGE_TAG }}
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
Expand Down Expand Up @@ -63,15 +85,15 @@ jobs:
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}

deploy_to_staging:
needs: [docker_build_and_publish_amd, deploy_to_dev]
needs: [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_amd.outputs.AMD_IMAGE_TAG }}
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
Expand Down Expand Up @@ -108,15 +130,15 @@ jobs:
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}

deploy_to_production:
needs: [docker_build_and_publish_amd, deploy_to_staging]
needs: [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_amd.outputs.AMD_IMAGE_TAG }}
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
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/docker-build-publish-amd.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/docker-build-publish-arm.yml

This file was deleted.

55 changes: 50 additions & 5 deletions .github/workflows/docker-image-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,60 @@ on:

jobs:
build_and_push_docker_image_amd:
if: github.repository_owner == 'NethermindEth'
runs-on: ubuntu-latest
steps:
- name: Call AMD Build Workflow
uses: ./.github/workflows/docker-build-publish-amd.yml
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: 'linux/amd64'
push: true
tags: nethermindeth/juno:${{ github.event.inputs.tag }}

build_and_push_docker_image_arm:
if: github.repository_owner == 'NethermindEth'
runs-on: self-hosted
steps:
- name: Call ARM Build Workflow
uses: ./.github/workflows/docker-build-publish-arm.yml
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push ARM
uses: docker/build-push-action@v4
with:
context: .
platforms: 'linux/arm64'
push: true
tags: nethermindeth/juno:${{ github.event.inputs.tag }}-arm64

- name: Cleanup self-hosted
run: |
docker system prune -af
create_and_push_official_image:
if: github.repository_owner == 'NethermindEth' && github.event.inputs.repo_type == 'official'
Expand All @@ -51,4 +95,5 @@ jobs:
- name: Clean up environment
if: always()
run: |
rm -f ${HOME}/.docker/config.json
rm -f ${HOME}/.docker/config.json

0 comments on commit 58c5955

Please sign in to comment.