Skip to content

Commit

Permalink
refactor(ci-cd): integrate reusable workflows for image publishing in…
Browse files Browse the repository at this point in the history
… ci pipelines
  • Loading branch information
WarriorsSami committed Sep 21, 2024
1 parent 7fed0f5 commit 482cc3c
Show file tree
Hide file tree
Showing 15 changed files with 295 additions and 524 deletions.
94 changes: 0 additions & 94 deletions .github/workflows/anubis-eval-cd.yaml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/anubis-eval-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Anubis - Build Docker image and publish to GHCR and Docker Hub

on:
push:
tags:
- "anubis/**"

env:
NAMESPACE: pantheonix
REPOSITORY: anubis
IMAGE_NAME: anubis-eval
BUILD_CONTEXT: anubis-eval

jobs:
build:
name: Build and Test Anubis Eval Microservice
runs-on: ubuntu-latest
defaults:
run:
working-directory: anubis-eval

steps:
- uses: actions/checkout@v4

- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./anubis-eval/tests-setup/docker-compose.yaml"
up-flags: "--build -d"

- name: Setup rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: '1.72.0'

- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-nextest
version: '0.9.64'
locked: true

- name: Build
run: cargo build --release

- name: Test
run: cargo nextest run --all-features --profile ci

deploy_to_ghcr:
needs: build
uses: ./.github/workflows/step-deploy-to-ghcr.yaml
with:
image_name: ${{ env.IMAGE_NAME }}
build_context: ${{ env.BUILD_CONTEXT }}

deploy_to_docker_hub:
needs: build
uses: ./.github/workflows/step-deploy-to-docker-hub.yaml
with:
namespace: ${{ env.NAMESPACE }}
repository: ${{ env.REPOSITORY }}
build_context: ${{ env.BUILD_CONTEXT }}
26 changes: 26 additions & 0 deletions .github/workflows/dapr-config-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dapr - Build Docker image and publish to GHCR and Docker Hub

on:
push:
tags:
- "dapr/**"

env:
NAMESPACE: pantheonix
REPOSITORY: asgard-dapr
IMAGE_NAME: asgard-dapr-config
BUILD_CONTEXT: dapr

jobs:
deploy_to_ghcr:
uses: ./.github/workflows/step-deploy-to-ghcr.yaml
with:
image_name: ${{ env.IMAGE_NAME }}
build_context: ${{ env.BUILD_CONTEXT }}

deploy_to_docker_hub:
uses: ./.github/workflows/step-deploy-to-docker-hub.yaml
with:
namespace: ${{ env.NAMESPACE }}
repository: ${{ env.REPOSITORY }}
build_context: ${{ env.BUILD_CONTEXT }}
60 changes: 0 additions & 60 deletions .github/workflows/dapr-config.yaml

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/enki-problems-cd.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/enki-problems-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Enki - Build Docker image and publish to GHCR and Docker Hub

on:
push:
tags:
- "enki/**"

env:
NAMESPACE: pantheonix
REPOSITORY: enki
IMAGE_NAME: enki-problems
BUILD_CONTEXT: enki-problems

jobs:
build:
name: Build and Test Enki Problems Microservice
runs-on: ubuntu-latest
defaults:
run:
working-directory: enki-problems

steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Build
run: |
dotnet restore "src/EnkiProblems.HttpApi.Host/EnkiProblems.HttpApi.Host.csproj"
dotnet restore "test/EnkiProblems.Application.Tests/EnkiProblems.Application.Tests.csproj"
dotnet build --no-restore
- name: Test
run: dotnet test -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

deploy_to_ghcr:
needs: build
uses: ./.github/workflows/step-deploy-to-ghcr.yaml
with:
image_name: ${{ env.IMAGE_NAME }}
build_context: ${{ env.BUILD_CONTEXT }}

deploy_to_docker_hub:
needs: build
uses: ./.github/workflows/step-deploy-to-docker-hub.yaml
with:
namespace: ${{ env.NAMESPACE }}
repository: ${{ env.REPOSITORY }}
build_context: ${{ env.BUILD_CONTEXT }}
Loading

0 comments on commit 482cc3c

Please sign in to comment.