Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Commit 77255cf

Browse files
authored
Implement action (#1)
1 parent a74f421 commit 77255cf

File tree

20 files changed

+290484
-0
lines changed

20 files changed

+290484
-0
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
node_modules
3+
dist
4+
coverage

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
ecmaVersion: 9,
5+
sourceType: 'module',
6+
project: ['./tsconfig.json', './tsconfig.eslint.json'],
7+
},
8+
9+
extends: ['airbnb-typescript/base', 'plugin:prettier/recommended', 'plugin:jest/recommended'],
10+
rules: {
11+
'import/named': 'off',
12+
'import/prefer-default-export': 'off',
13+
'no-console': 'off',
14+
'no-restricted-globals': 'off',
15+
'react/jsx-curly-newline': 'off',
16+
'react/jsx-one-expression-per-line': 'off',
17+
'react/jsx-props-no-spreading': 'off',
18+
'react/jsx-wrap-multilines': 'off',
19+
'@typescript-eslint/ban-ts-ignore': 'warn',
20+
'@typescript-eslint/explicit-function-return-type': 'off',
21+
'@typescript-eslint/indent': 'off',
22+
'@typescript-eslint/quotes': 'off',
23+
},
24+
env: {
25+
node: true,
26+
es6: true,
27+
'jest/globals': true,
28+
},
29+
};

.gitattributes

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Common .gitattributes file courtesy of
2+
# https://github.com/alexkaratarakis/gitattributes/blob/master/Common.gitattributes
3+
4+
# Auto detect text files and perform LF normalization
5+
* text=auto eol=lf
6+
7+
# The above will handle all files NOT found below
8+
9+
# Documents
10+
*.pdf diff=astextplain
11+
*.PDF diff=astextplain
12+
*.rtf diff=astextplain
13+
*.RTF diff=astextplain
14+
*.md text
15+
16+
# Graphics
17+
*.png binary
18+
*.jpg binary
19+
*.jpeg binary
20+
*.gif binary
21+
*.tif binary
22+
*.tiff binary
23+
*.ico binary
24+
# SVG treated as an asset (binary) by default.
25+
*.svg binary
26+
#*.svg text
27+
*.eps binary

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
types:
7+
- opened
8+
- synchronize
9+
10+
jobs:
11+
12+
lint:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
if: github.event_name == 'push'
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@master
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
23+
- name: Lint
24+
run: yarn lint
25+
26+
test:
27+
name: Test
28+
runs-on: ubuntu-latest
29+
if: github.event_name == 'push'
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@master
33+
34+
- name: Install dependencies
35+
run: yarn install --frozen-lockfile
36+
37+
- name: Test
38+
run: yarn test
39+
env:
40+
CI: true
41+
42+
deployDraft:
43+
name: Deploy draft to Netlify
44+
runs-on: ubuntu-latest
45+
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v1
49+
50+
- name: Install
51+
run: yarn install --frozen-lockfile
52+
53+
- name: Build action
54+
run: yarn build
55+
56+
- name: Generate simple HTML document
57+
run: |
58+
mkdir -p example
59+
echo -e "<pre>$(date -u)\n$GITHUB_SHA\n$GITHUB_REF</pre>" > example/index.html
60+
61+
- name: Test action
62+
uses: ./
63+
with:
64+
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
66+
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
67+
build-dir: './example'
68+
draft: true
69+
comment-on-pull-request: true
70+
71+
deployProduction:
72+
name: Deploy production to Netlify
73+
runs-on: ubuntu-latest
74+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
75+
steps:
76+
- name: Checkout repository
77+
uses: actions/checkout@v1
78+
79+
- name: Install
80+
run: yarn install --frozen-lockfile
81+
82+
- name: Build action
83+
run: yarn build
84+
85+
- name: Generate simple HTML document
86+
run: |
87+
mkdir -p example
88+
echo -e "<pre>$(date -u)\n$GITHUB_SHA\n$GITHUB_REF</pre>" > example/index.html
89+
90+
- name: Test action
91+
uses: ./
92+
with:
93+
github-token: ${{ secrets.GITHUB_TOKEN }}
94+
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
95+
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
96+
build-dir: './example'
97+
comment-on-commit: true

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
lib-cov
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
*.swp
10+
11+
pids
12+
logs
13+
results
14+
tmp
15+
16+
node_modules
17+
coverage
18+
.env
19+
20+
# OS metadata
21+
.DS_Store
22+
Thumbs.db

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
node_modules
3+
dist
4+
coverage

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "lf",
3+
"printWidth": 120,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"parser": "typescript"
7+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Alex Gabites
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)