diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 8f65788..da8ccd5 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -4,27 +4,43 @@ name: Node.js CI on: - push: - branches: [ master ] - pull_request: - branches: [ master ] + push: + branches: [master] + pull_request: + branches: [master] jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install - - run: npm run build --if-present - - run: npm test + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + - name: cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + run: npm install + - name: Build + run: npm run build --if-present + - name: Test + run: npm test diff --git a/package.json b/package.json index 124c7f2..a7c0bab 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "dev": "NODE_ENV=development nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/server.ts", "prebuild": "rm -rf dist/ && prettier --write src/", "build": "tsc", - "test": "NODE_ENV=test jest --forceExit --coverage --verbose" + "test": "NODE_ENV=test jest --forceExit --coverage --verbose", + "publish": "git push heroku master", + "log": "heroku log -t" }, "devDependencies": { "@types/axios": "^0.14.0",