diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index ef4f1f14..21d97840 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -7,7 +7,7 @@ on: pull_request: branches: - "develop" - workflow_run: # this will get triggered on main branch only + workflow_run: workflows: ["Linting"] types: - completed @@ -18,10 +18,12 @@ on: jobs: test: name: Test - # if: github.event.pull_request.draft == false - # uses: ./.github/workflows/_test_with_coverage.yml runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success'}} + if: | + (${{github.event_name == 'pull_request'}} && ${{github.event.action == 'opened'}} && ${{github.event.pull_request.base.ref == 'develop'}}) || + (${{github.event.workflow_run.conclusion == 'success'}} && + (${{github.ref == 'refs/heads/main'}} || ${{github.ref == 'refs/heads/develop'}})) + # if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - run: echo "The triggering workflow 'Linting' passed and running tests" - run: echo "Tests completed." @@ -49,6 +51,9 @@ jobs: - name: Flutter Get Dependencies run: flutter pub get + - name: Dart Build-runner + run: dart run build_runner build --delete-conflicting-outputs + - name: ⚠️ℹ️ Run Dart analysis uses: zgosalvez/github-actions-analyze-dart@v3 with: @@ -62,7 +67,7 @@ jobs: IGNORE_GITIGNORED_FILES: true FILTER_REGEX_EXCLUDE: "\\.freezed\\.dart$" CREATE_LOG_FILE: true - DISABLE_ERRORS: true + # DISABLE_ERRORS: true - run: echo "Analyzing completed." diff --git a/.github/workflows/deploy_workflow.yml b/.github/workflows/deploy_workflow.yml index 0293562f..3f6da725 100644 --- a/.github/workflows/deploy_workflow.yml +++ b/.github/workflows/deploy_workflow.yml @@ -1,12 +1,12 @@ --- name: Deploy Apps on: - # push: - # branches: - # - "main" - # pull_request: - # branches: - # - "main" + push: + branches: + - "main" + pull_request: + branches: + - "main" workflow_run: workflows: - "Test, Analyze, Build" @@ -16,16 +16,21 @@ on: # workflow_dispatch: jobs: - predeploy: + pre-deploy: name: Pre-deploy runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' + # if: | + # (${{github.event_name == 'pull_request'}} && ${{github.event.action == 'opened'}} && ${{github.event.pull_request.base.ref == 'main'}}) || + # (${{github.event.workflow_run.conclusion == 'success'}} && ${{github.ref == 'refs/heads/main'}}) steps: - run: echo "Predeploy Job Finished" + deploy: name: Deploy Apps if: github.event.pull_request.draft == false uses: ./.github/workflows/_deploy-env-apps.yml - needs: predeploy + needs: pre-deploy permissions: contents: write secrets: inherit