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 e1229fc
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 31 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@ name: CI/CD

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

jobs:
docker_build_and_publish_amd:
runs-on: ubuntu-latest
outputs:
DOCKER_IMAGE_TAG: ${{ steps.define_tag.outputs.DOCKER_IMAGE_TAG }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Define docker image tag
id: define_tag
run: echo "DOCKER_IMAGE_TAG=$(git describe --tags)" >> $GITHUB_ENV

- name: Call AMD Build Workflow
id: amd_build
uses: ./.github/workflows/docker-build-publish-amd.yml
with:
tag: ${{ github.ref }}
outputs:
AMD_IMAGE_TAG: ${{ steps.amd_build.outputs.AMD_IMAGE_TAG }}
tag: ${{ env.DOCKER_IMAGE_TAG }}

deploy_to_dev:
needs: [docker_build_and_publish_amd]
Expand All @@ -26,7 +34,7 @@ jobs:
- 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_amd.outputs.DOCKER_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 @@ -71,7 +79,7 @@ jobs:
- 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_amd.outputs.DOCKER_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 @@ -116,7 +124,7 @@ jobs:
- 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_amd.outputs.DOCKER_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
15 changes: 6 additions & 9 deletions .github/workflows/docker-build-publish-amd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Docker Build and Publish AMD

on:
workflow_call:
inputs:
tag:
required: true
type: string

jobs:
build_and_push_amd:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -27,11 +31,4 @@ jobs:
context: .
platforms: 'linux/amd64'
push: true
tags: nethermindeth/juno:${{ github.ref }}

- name: Set Output
id: set_output
run: echo "AMD_IMAGE_TAG=${{ github.ref }}" >> $GITHUB_ENV

outputs:
AMD_IMAGE_TAG: ${{ steps.set_output.outputs.AMD_IMAGE_TAG }}
tags: nethermindeth/juno:${{ github.event.inputs.tag }}
15 changes: 6 additions & 9 deletions .github/workflows/docker-build-publish-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: Docker Build and Publish ARM

on:
workflow_call:
inputs:
tag:
required: true
type: string

jobs:
build_and_push_arm:
if: github.repository_owner == 'NethermindEth'
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -32,11 +36,4 @@ jobs:

- name: Cleanup self-hosted
run: |
docker system prune -af
- name: Set Output
id: set_output
run: echo "ARM_IMAGE_TAG=${{ github.event.inputs.tag }}-arm64" >> $GITHUB_ENV

outputs:
ARM_IMAGE_TAG: ${{ steps.set_output.outputs.ARM_IMAGE_TAG }}
docker system prune -af
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 e1229fc

Please sign in to comment.