diff --git a/.github/workflows/anubis-eval-ci.yaml b/.github/workflows/anubis-eval-pr-verify.yaml similarity index 81% rename from .github/workflows/anubis-eval-ci.yaml rename to .github/workflows/anubis-eval-pr-verify.yaml index 1c8383c..5b6bc6e 100644 --- a/.github/workflows/anubis-eval-ci.yaml +++ b/.github/workflows/anubis-eval-pr-verify.yaml @@ -1,18 +1,16 @@ -name: Anubis - Build and Test Submissions Service +name: Anubis - PR Verify on: - push: - paths: - - "anubis-eval/**" - - ".github/workflows/anubis-eval-ci.yaml" - pull_request: + branches: + - develop paths: - "anubis-eval/**" - - ".github/workflows/anubis-eval-ci.yaml" + - ".github/workflows/anubis-eval-pr-verify.yaml" jobs: build: + name: Build and Test Anubis Eval Microservice runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/enki-problems-ci.yaml b/.github/workflows/enki-problems-pr-verify.yaml similarity index 77% rename from .github/workflows/enki-problems-ci.yaml rename to .github/workflows/enki-problems-pr-verify.yaml index 454ef7f..fe115ef 100644 --- a/.github/workflows/enki-problems-ci.yaml +++ b/.github/workflows/enki-problems-pr-verify.yaml @@ -1,18 +1,16 @@ -name: Enki - Build and Test Problems Service +name: Enki - PR Verify on: - push: - paths: - - "enki-problems/**" - - ".github/workflows/enki-problems-ci.yaml" - pull_request: + branches: + - develop paths: - "enki-problems/**" - - ".github/workflows/enki-problems-ci.yaml" + - ".github/workflows/enki-problems-pr-verify.yaml" jobs: build: + name: Build and Test Enki Problems Microservice runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/hermes-tests-ci.yaml b/.github/workflows/hermes-tests-pr-verify.yaml similarity index 75% rename from .github/workflows/hermes-tests-ci.yaml rename to .github/workflows/hermes-tests-pr-verify.yaml index 5c1cdf3..fbf5cd8 100644 --- a/.github/workflows/hermes-tests-ci.yaml +++ b/.github/workflows/hermes-tests-pr-verify.yaml @@ -1,21 +1,19 @@ -name: Hermes - Build and Test Tests Service +name: Hermes - PR Verify on: - push: - paths: - - "hermes-tests/**" - - ".github/workflows/hermes-tests-ci.yaml" - pull_request: + branches: + - develop paths: - "hermes-tests/**" - - ".github/workflows/hermes-tests-ci.yaml" + - ".github/workflows/hermes-tests-pr-verify.yaml" env: HERMES_CONFIG: ${{ secrets.HERMES_CONFIG }} jobs: build: + name: Build and Test Hermes Tests Microservice runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/quetzalcoatl-auth-ci.yaml b/.github/workflows/quetzalcoatl-auth-pr-verify.yaml similarity index 75% rename from .github/workflows/quetzalcoatl-auth-ci.yaml rename to .github/workflows/quetzalcoatl-auth-pr-verify.yaml index e7af4b9..e9e8bf6 100644 --- a/.github/workflows/quetzalcoatl-auth-ci.yaml +++ b/.github/workflows/quetzalcoatl-auth-pr-verify.yaml @@ -1,18 +1,16 @@ -name: Quetzalcoatl - Build and Test Auth Service +name: Quetzalcoatl - PR Verify on: - push: - paths: - - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth-ci.yaml" - pull_request: + branches: + - develop paths: - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth-ci.yaml" + - ".github/workflows/quetzalcoatl-auth-pr-verify.yaml" jobs: build: + name: Build and Test Quetzalcoatl Auth Microservice runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/step-deploy-to-docker-hub.yaml b/.github/workflows/step-deploy-to-docker-hub.yaml new file mode 100644 index 0000000..9bfd034 --- /dev/null +++ b/.github/workflows/step-deploy-to-docker-hub.yaml @@ -0,0 +1,47 @@ +name: "Step - Push Docker image to Docker Hub Registry" + +on: + workflow_call: + inputs: + namespace: + type: string + required: true + repository: + type: string + required: true + build_context: + type: string + required: true + +jobs: + deploy: + name: "Deploy to Docker Hub" + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ inputs.namespace }}/${{ inputs.repository }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: ${{ inputs.build_context }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/step-deploy-to-ghcr.yaml b/.github/workflows/step-deploy-to-ghcr.yaml new file mode 100644 index 0000000..e3e69e5 --- /dev/null +++ b/.github/workflows/step-deploy-to-ghcr.yaml @@ -0,0 +1,47 @@ +name: "Step - Push Docker image to GitHub Container Registry (GHCR)" + +on: + workflow_call: + inputs: + image_name: + type: string + required: true + build_context: + type: string + required: true + +jobs: + deploy: + name: "Deploy to GHCR" + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }} + tags: | + type=semver,pattern={{version}} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: ${{ inputs.build_context }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}