diff --git a/.github/scripts/deployability_checker.sh b/.github/scripts/deployability_checker.sh index 6d0b7b0..45b367f 100755 --- a/.github/scripts/deployability_checker.sh +++ b/.github/scripts/deployability_checker.sh @@ -24,4 +24,8 @@ else echo "deploy_env=Dockerfile" >> $GITHUB_OUTPUT exit 0 fi + else + echo "[*] This Challenge is not deployable" + exit 1 + fi fi \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6de7c5b..c8b8c7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: - master workflow_dispatch: +###################### jobs: test: name: 'Test Challenge Structure' @@ -26,6 +27,8 @@ jobs: - name: Test Challenge directory structure run: .github/scripts/chall_structure_validator.py ${{github.head_ref}} +###################### + test_deployability: name: 'Check Deployability' defaults: @@ -48,15 +51,17 @@ jobs: - name: 'Check Output' run: echo "${{steps.deployable.outputs.deploy_env}}" + +###################### build_dockerfile: name: 'Build Challenge Container using Dockerfile' + needs: test_deployability + if: ${{needs.test_deployability.outputs.deploy_env}} == 'Dockerfile' defaults: run: shell: bash runs-on: ubuntu-latest - needs: test_deployability - if: ${{needs.test_deployability.outputs.deploy_env}} == 'Dockerfile' steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -75,15 +80,16 @@ jobs: - name: Check Running Container run: docker ps -a - +###################### + build_docker-compose: name: 'Build Challenge Container using Docker Compose' + needs: test_deployability + if: ${{ needs.test_deployability.outputs.deploy_env }} == 'docker-compose' defaults: run: shell: bash runs-on: ubuntu-latest - needs: test_deployability - if: ${{ needs.test_deployability.outputs.deploy_env }} == 'docker-compose' steps: - name: Checkout uses: actions/checkout@v4