Skip to content

Commit

Permalink
ci: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
d3lm committed Oct 28, 2020
1 parent d40d3ff commit 93f1299
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 68 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deployment

on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy to Github Pages
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '14'

- 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
run: npm install

- name: Build
run: npm run build:prerender-ghpages

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/browser
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Node CI

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

jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '14'

- 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
run: npm install

- name: Lint and Format
run: npm run lint:ci
e2e:
name: Cypress on Chrome
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run Cypress
uses: cypress-io/github-action@v2
with:
start: npm start
browser: chrome
record: true
wait-on: 'http://localhost:4200'
parallel: true
group: 'Demp App'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"test": "ng test",
"test:ci": "npm run test && start-server-and-test start http-get://localhost:4200 e2e:ci",
"test:watch": "npm run test -- --watch",
"lint:check": "ng lint",
"lint:fix": "ng lint app --fix && ng lint ngx-drag-to-select --fix",
"e2e": "cypress open",
"e2e:ci": "cypress run --record --parallel --group $STAGE_NAME --browser chrome",
"ci": "npm run lint:check && npm run format:check && npm run test:ci",
"lint:check": "ng lint",
"lint:fix": "ng lint app --fix && ng lint ngx-drag-to-select --fix",
"lint:ci": "npm run lint:check && npm run format:check",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 -k ./projects/ngx-drag-to-select"
},
"husky": {
Expand Down

0 comments on commit 93f1299

Please sign in to comment.