Skip to content

Add one more step to run tests and deploy only if tests are passing #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions docs/README_environment_github_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]"
run: npm run ng -- deploy --base-href=/the-repository-name/ --name="Displayed Username" --email="[email protected]"
```

6. Make sure to replace **`/the-repository-name/`**, **`Displayed Username`** and **`[email protected]`** 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 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.

Expand Down Expand Up @@ -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.

---

Expand Down