Skip to content

Commit

Permalink
Update compile and deploy conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveworley committed Sep 13, 2023
1 parent d808e1a commit 366b076
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
name: Compile
on:
workflow_dispatch:
workflow_run:
workflows:
- Test and lint
types:
- completed

env:
NODE_ENV: production

jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

0 comments on commit 366b076

Please sign in to comment.