Skip to content

Commit 97271a9

Browse files
kirbahfmalcher
andauthored
Add one more step to run tests and deploy only if tests are passing (#184)
* Add one more step to run tests and deploy only if tests are passing * Update docs/README_environment_github_actions.md Co-authored-by: Ferdinand Malcher <[email protected]> --------- Co-authored-by: Ferdinand Malcher <[email protected]>
1 parent a70b477 commit 97271a9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

docs/README_environment_github_actions.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,21 @@ More info can be found here:
5858
node-version: 20.x
5959
cache: "npm"
6060

61+
- name: Install dependencies
62+
run: npm install
63+
64+
- name: Run tests
65+
run: npm run ng -- test --no-watch --no-progress --browsers=ChromeHeadless
66+
6167
- name: Prepare and deploy
6268
env:
6369
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
run: |
65-
npm install
66-
npm run ng -- deploy --base-href=/the-repository-name/ --name="Displayed Username" --email="[email protected]"
70+
run: npm run ng -- deploy --base-href=/the-repository-name/ --name="Displayed Username" --email="[email protected]"
6771
```
6872
6973
6. Make sure to replace **`/the-repository-name/`**, **`Displayed Username`** and **`[email protected]`** with correct values in above snippet.
70-
7. You can also control when your workflows are triggered:
74+
7. If you do not have tests you may remove the step "Run tests" from the example.
75+
8. You can also control when your workflows are triggered:
7176

7277
- It can be helpful to not have your workflows run on every push to every branch in the repo.
7378

@@ -100,8 +105,8 @@ More info can be found here:
100105

101106
- For more information see [Events that trigger workflows](https://help.github.com/articles/events-that-trigger-workflows) and [Workflow syntax for GitHub Actions](https://help.github.com/articles/workflow-syntax-for-github-actions#on).
102107

103-
8. Commit and Push to add the workflow file.
104-
9. Done.
108+
9. Commit and Push to add the workflow file.
109+
10. Done.
105110

106111
---
107112

0 commit comments

Comments
 (0)