Skip to content

Commit

Permalink
ci: setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
moesjarraf committed Feb 22, 2023
1 parent 4b1952f commit 755041a
Show file tree
Hide file tree
Showing 4 changed files with 20,985 additions and 10,767 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ['master']
pull_request:
branches: '*'

jobs:
test:
runs-on: ubuntu-latest
services:
mongo:
image: mongo
ports:
- 27017:27017
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:all

publish:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ See [this](https://github.com/moesjarraf/nestjs-example) repository for an examp
## Documentation

todo

## Development

Commit messages should be formatted according to semantic-release standards, see [this](https://github.com/semantic-release/semantic-release#commit-message-format) link for more information. A tool has been added to the project to make adhering to the standards easier.

```bash
# add source files
git add .

# format commit message
npm run commit

# push
git push -u origin master
```
Loading

0 comments on commit 755041a

Please sign in to comment.