diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index cefa0df..9f9b910 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -1,6 +1,11 @@ name: Compile on: workflow_dispatch: + workflow_run: + workflows: + - Test and lint + types: + - completed env: NODE_ENV: production @@ -8,6 +13,7 @@ env: jobs: build: runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21b7ab3..e4d11e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,20 +25,3 @@ jobs: - name: Build run: npm run build - - compile: - if: github.ref == 'refs/heads/main' - needs: test-lint - runs-on: ubuntu-latest - steps: - - name: Trigger the build - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { data: workflows } = await github.actions.listRepoWorkflows(); - const workflowIdToTrigger = workflows.find(workflow => workflow.name === 'Compile').id; - - await github.actions.createWorkflowDispatch({ - workflow_id: workflowIdToTrigger, - });