From 117fdd5bd68dec9d4c9abe31ada7bf9475532720 Mon Sep 17 00:00:00 2001 From: Kiryl Bahdanau Date: Fri, 3 May 2024 21:25:00 +0200 Subject: [PATCH 1/2] Add one more step to run tests and deploy only if tests are passing --- docs/README_environment_github_actions.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/README_environment_github_actions.md b/docs/README_environment_github_actions.md index 2de0bfe..5212d7e 100644 --- a/docs/README_environment_github_actions.md +++ b/docs/README_environment_github_actions.md @@ -58,16 +58,21 @@ More info can be found here: node-version: 20.x cache: "npm" + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm run ng -- test --no-watch --no-progress --browsers=ChromeHeadless + - name: Prepare and deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npm install - npm run ng -- deploy --base-href=/the-repository-name/ --name="Displayed Username" --email="mail@example.org" + run: npm run ng -- deploy --base-href=/the-repository-name/ --name="Displayed Username" --email="mail@example.org" ``` 6. Make sure to replace **`/the-repository-name/`**, **`Displayed Username`** and **`mail@example.org`** with correct values in above snippet. -7. You can also control when your workflows are triggered: +7. If you do not have tests you may remove step "Run tests" from the example. +8. You can also control when your workflows are triggered: - It can be helpful to not have your workflows run on every push to every branch in the repo. @@ -100,8 +105,8 @@ More info can be found here: - 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). -8. Commit and Push to add the workflow file. -9. Done. +9. Commit and Push to add the workflow file. +10. Done. --- From e1328ffbc9eafb09b495327936c2de4cdf5c6dfe Mon Sep 17 00:00:00 2001 From: Kiryl Bahdanau Date: Fri, 3 May 2024 21:49:38 +0200 Subject: [PATCH 2/2] Update docs/README_environment_github_actions.md Co-authored-by: Ferdinand Malcher --- docs/README_environment_github_actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_environment_github_actions.md b/docs/README_environment_github_actions.md index 5212d7e..61fa9e7 100644 --- a/docs/README_environment_github_actions.md +++ b/docs/README_environment_github_actions.md @@ -71,7 +71,7 @@ More info can be found here: ``` 6. Make sure to replace **`/the-repository-name/`**, **`Displayed Username`** and **`mail@example.org`** with correct values in above snippet. -7. If you do not have tests you may remove step "Run tests" from the example. +7. If you do not have tests you may remove the step "Run tests" from the example. 8. You can also control when your workflows are triggered: - It can be helpful to not have your workflows run on every push to every branch in the repo.