diff --git a/.github/workflows/backend-pipeline.yml b/.github/workflows/backend-pipeline.yml index 5481987..892e181 100644 --- a/.github/workflows/backend-pipeline.yml +++ b/.github/workflows/backend-pipeline.yml @@ -6,6 +6,9 @@ on: task-version: required: true type: string + outputs: + pipeline-success: + value: ${{ jobs.notify-success.outputs.pipeline_success }} env: ROTINI_CI: 1 @@ -85,3 +88,13 @@ jobs: - name: Test run: | task be:test + notify-success: + runs-on: ubuntu-latest + name: Notify success + needs: [lint, test] + steps: + - id: set-output + working-directory: / + run: echo "pipeline_success=true" >> "$GITHUB_OUTPUT" + outputs: + pipeline_success: ${{ steps.set-output.outputs.pipeline_success }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0f5c93..6d16908 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,3 +58,46 @@ jobs: task-version: ${{ needs.preflight.outputs.task_version }} needs: preflight if: needs.preflight.outputs.fe_changed == 'true' + frontend-ok: + name: Frontend Pipeline Success + runs-on: ubuntu-latest + needs: [frontend, preflight] + if: | + always() + && ( + needs.frontend.outputs.pipeline-success == 'true' + || needs.preflight.outputs.fe_changed == 'false' + ) + steps: + - run: | + if [ "${{ needs.preflight.outputs.fe_changed }}" == "false" ] + then + exit 0 + fi + if [ "${{ needs.frontend.outputs.pipeline-success }}" == "true" ] + then + exit 0 + fi + exit 1 + backend-ok: + name: Backend Pipeline Success + runs-on: ubuntu-latest + needs: [backend, preflight] + if: | + always() + && ( + needs.backend.outputs.pipeline-success == 'true' + || needs.preflight.outputs.be_changed == 'false' + ) + steps: + - run: | + if [ "${{ needs.preflight.outputs.be_changed }}" == "false" ] + then + exit 0 + fi + if [ "${{ needs.backend.outputs.pipeline-success }}" == "true" ] + then + exit 0 + fi + exit 1 + diff --git a/.github/workflows/frontend-pipeline.yml b/.github/workflows/frontend-pipeline.yml index cae4f6a..fa5b105 100644 --- a/.github/workflows/frontend-pipeline.yml +++ b/.github/workflows/frontend-pipeline.yml @@ -6,6 +6,9 @@ on: task-version: required: true type: string + outputs: + pipeline-success: + value: ${{ jobs.notify-success.outputs.pipeline_success }} env: NODE_VERSION: lts/hydrogen @@ -177,6 +180,16 @@ jobs: repo: context.repo.repo, body: `:eyes: Branch deployed at ${process.env.DRAFT_URL}` }) + notify-success: + runs-on: ubuntu-latest + name: Notify success + needs: [lint, test, typecheck, build] + steps: + - id: set-output + working-directory: / + run: echo "pipeline_success=true" >> "$GITHUB_OUTPUT" + outputs: + pipeline_success: ${{ steps.set-output.outputs.pipeline_success }} fe-deploy: runs-on: ubuntu-latest name: Deploy