1
0
Fork 0

Merge pull request #490 from kremalicious/feature/updates

Build and dev updates
This commit is contained in:
Matthias Kretschmann 2021-01-30 20:49:26 +01:00 committed by GitHub
commit a4cbce7a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 7183 additions and 43704 deletions

View File

@ -10,7 +10,7 @@ LICENSE
.vscode
public
.cache
.travis.yml
.github
package-lock.json
README.md
coverage

69
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,69 @@
name: 'CI'
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: Cache node_modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- run: npm ci
- run: npm test
- uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Cache Gatsby Cache Folder
uses: actions/cache@v1
id: gatsby-cache-folder
with:
path: .cache
key: ${{ runner.os }}-cache-gatsby
restore-keys: |
${{ runner.os }}-cache-gatsby
- name: Cache Gatsby Public Folder
uses: actions/cache@v1
id: gatsby-public-folder
with:
path: public/
key: ${{ runner.os }}-public-gatsby
restore-keys: |
${{ runner.os }}-public-gatsby
- run: npm ci
- run: npm run build
env:
GATSBY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,41 +0,0 @@
dist: xenial
language: node_js
node_js: node
git:
depth: 10
cache:
npm: true
directories:
- public
before_install:
- sudo apt-get -qq update
- sudo apt-get install python3-pip
- sudo -H pip3 install --upgrade pip
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- './cc-test-reporter before-build'
script:
- npm test
- './cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT'
- travis_wait 60 npm run build
after_success:
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
- npm run deploy
notifications:
email: false
slack:
template:
- '%{branch} *%{result}* build (<%{build_url}|#%{build_number}>) for <%{compare_url}|%{commit}>'
- 'Execution time: *%{duration}*'
- 'Message: %{message}'
rooms:
- secure: 'Ot7Ryl4PW0/TUo4t4Y3J6AbmxqNUtFOI72vNabNX2IdEiU78q+M3esPEkT2I/z0S2Vda9ogRkRbKa5blE2ZEo74/9CUYRXX/syPSZL9tpHDd600wmiObee469Au8dSO48n8G9U+Dm1q60O6oiEGsrrAR6fNE386QEfDhVqKKwBKHk9RcUocUO2b+0WKI7MJk+j5G4+sxv/5ax8prGx0sD6bRoGRuNpyW/MZ9uylBV2WOdmHfEY9D8GYpzVs2JqTB7xr/OL9d+puZPQSdqGfa7xtc+APFiKK//aW/ffOsNzGa4kygC94nfV4oJceMUO3v0bDpB5aXM1YG02EyQzSwpGCbtnbP9Ei/ANcGqiFjPm1/ZVAiwPzT8XZLWkFjy+sOfmF+xmszUCoRiJBVxfL0tx0d1o/JIvgA5m+/iIpro70ep0nBHTiDt2AoxaGGE9GnIT20uVXJJIdXIwTWhVx4HnkptYsFel9l2/oc24S+CnitRaCtGQCiAMNNCESL1AcHCRot/4gm3uuZLdYEA1juHUvgEEH6jG5T2XWaq4uEbDZKdu8y7YMW105FytEsyNU3Tzem4c024EIAhBshSfg5N/iwVeic47E1QAz/5RtfBNLQaEPY4TGJYJvTOaCevjYC7mKlYBEoZmsfT0uNaWqEXUxUwLg5Ih8JoLQKvH6H4fA='

View File

@ -1,5 +1,5 @@
<p align="center">
<a href="https://kremalicious.com"><img src="src/images/github-header.png" /></a>
<a href="https://kremalicious.com"><img src="[src/images/github-header.png](https://raw.githubusercontent.com/kremalicious/portfolio/main/src/images/github-header.png)" /></a>
</p>
<p align="center">
<strong>🍭 My blog built with <a href="http://gatsbyjs.org">Gatsby</a> + TypeScript. Neat.</strong>
@ -8,10 +8,9 @@
<a href="https://kremalicious.com">kremalicious.com</a>
</p>
<p align="center">
<a href="https://travis-ci.com/kremalicious/blog"><img src="https://travis-ci.com/kremalicious/blog.svg?branch=main" /></a>
<a href="https://github.com/kremalicious/blog/actions"><img src="https://github.com/kremalicious/blog/workflows/CI/badge.svg" /></a>
<a href="https://codeclimate.com/github/kremalicious/blog/maintainability"><img src="https://api.codeclimate.com/v1/badges/4e86c791349cd12368cd/maintainability" /></a>
<a href="https://codeclimate.com/github/kremalicious/blog/test_coverage"><img src="https://api.codeclimate.com/v1/badges/4e86c791349cd12368cd/test_coverage" /></a>
<a href="https://dependabot.com"><img src="https://badgen.net/dependabot/thepracticaldev/dev.to?icon=dependabot" /></a>
</p>
---
@ -33,6 +32,7 @@
- [👩‍🔬 Testing](#-testing)
- [🎈 Add a new post](#-add-a-new-post)
- [🚚 Deployment](#-deployment)
- [S3 Deployment](#s3-deployment)
- [🏛 Licenses](#-licenses)
- [Posts](#posts)
- [Photos & images](#photos--images)
@ -233,19 +233,18 @@ npm run new photo /path/to/photo.jpg
## 🚚 Deployment
Automatic deployments are triggered upon successful tests & builds on Travis:
Every branch or Pull Request is automatically deployed by [Vercel](https://vercel.com) with their GitHub integration. A link to a preview deployment will appear under each Pull Request.
- push to `main` initiates a live deployment
- any Pull Request, and subsequent pushes to it, initiates a beta deployment
The latest deployment of the `main` branch is automatically aliased to `kremalicious.com`.
The deploy command simply calls the [`scripts/deploy.sh`](scripts/deploy.sh) script, syncing the contents of the `public/` folder to S3:
### S3 Deployment
The deploy command simply calls the [`scripts/deploy-s3.sh`](scripts/deploy-s3.sh) script, syncing the contents of the `public/` folder to S3:
```bash
npm run deploy
npm run deploy:s3
```
The deploymeng script can be used locally too, the branch checks are only happening for Travis builds, allowing to deploy any branch from local machine.
## 🏛 Licenses
The MIT License (MIT)

View File

@ -77,7 +77,7 @@ module.exports = {
},
injectStyles: false,
extensions: [
'nord-visual-studio-code',
`${__dirname}/vendor/nord-visual-studio-code-0.15.0.vsix`,
`${__dirname}/vendor/polar-0.0.6.vsix`
],
languageAliases: {}

50600
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
"lint:md": "markdownlint './**/*.{md,markdown}' --ignore './{node_modules,public,.cache,.git,coverage}/**/*'",
"format": "prettier --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx,md,json,css,scss}'",
"tsc": "tsc --noEmit",
"deploy": "./scripts/deploy.sh",
"deploy:s3": "./scripts/deploy.sh",
"new": "babel-node ./scripts/new.js"
},
"browserslist": [
@ -29,8 +29,8 @@
"not op_mini all"
],
"dependencies": {
"@ethersproject/providers": "^5.0.14",
"@ethersproject/units": "^5.0.6",
"@ethersproject/providers": "^5.0.19",
"@ethersproject/units": "^5.0.9",
"@loadable/component": "^5.14.1",
"@web3-react/core": "^6.1.1",
"@web3-react/injected-connector": "^6.0.7",
@ -40,44 +40,43 @@
"ethereum-blockies": "github:MyEtherWallet/blockies",
"fast-exif": "^1.0.1",
"feather-icons": "^4.28.0",
"fraction.js": "^4.0.12",
"gatsby": "^2.26.0",
"gatsby-image": "^2.4.21",
"gatsby-plugin-catch-links": "^2.3.15",
"gatsby-plugin-feed": "^2.6.0",
"fraction.js": "^4.0.13",
"gatsby": "^2.31.1",
"gatsby-image": "^2.10.0",
"gatsby-plugin-catch-links": "^2.9.0",
"gatsby-plugin-feed": "^2.12.0",
"gatsby-plugin-lunr": "^1.5.2",
"gatsby-plugin-manifest": "^2.5.2",
"gatsby-plugin-manifest": "^2.11.0",
"gatsby-plugin-matomo": "^0.8.3",
"gatsby-plugin-meta-redirect": "^1.1.1",
"gatsby-plugin-offline": "^3.3.3",
"gatsby-plugin-react-helmet": "^3.3.14",
"gatsby-plugin-sass": "^2.4.2",
"gatsby-plugin-sharp": "^2.7.1",
"gatsby-plugin-sitemap": "^2.5.1",
"gatsby-plugin-svgr": "^2.0.2",
"gatsby-plugin-use-dark-mode": "^1.1.2",
"gatsby-plugin-offline": "^3.9.0",
"gatsby-plugin-react-helmet": "^3.9.0",
"gatsby-plugin-sass": "^2.8.0",
"gatsby-plugin-sharp": "^2.13.4",
"gatsby-plugin-sitemap": "^2.11.0",
"gatsby-plugin-svgr": "^2.1.0",
"gatsby-plugin-use-dark-mode": "^1.2.0",
"gatsby-plugin-webpack-size": "^1.0.0",
"gatsby-redirect-from": "^0.2.4",
"gatsby-remark-autolink-headers": "^2.4.1",
"gatsby-remark-autolink-headers": "^2.10.0",
"gatsby-remark-breaks": "^1.0.0",
"gatsby-remark-copy-linked-files": "^2.3.19",
"gatsby-remark-images": "^3.4.2",
"gatsby-remark-copy-linked-files": "^2.9.0",
"gatsby-remark-images": "^3.10.0",
"gatsby-remark-images-medium-zoom": "^1.7.0",
"gatsby-remark-smartypants": "^2.3.13",
"gatsby-remark-smartypants": "^2.9.0",
"gatsby-remark-vscode": "^3.2.0",
"gatsby-source-filesystem": "^2.4.2",
"gatsby-source-graphql": "^2.7.7",
"gatsby-transformer-remark": "^2.9.2",
"gatsby-transformer-sharp": "^2.5.21",
"intersection-observer": "^0.11.0",
"gatsby-source-filesystem": "^2.10.0",
"gatsby-source-graphql": "^2.13.0",
"gatsby-transformer-remark": "^2.15.0",
"gatsby-transformer-sharp": "^2.11.0",
"intersection-observer": "^0.12.0",
"node-fetch": "^2.6.1",
"nord-visual-studio-code": "github:arcticicestudio/nord-visual-studio-code",
"pigeon-maps": "^0.16.1",
"pigeon-maps": "^0.17.0",
"pigeon-marker": "^0.3.4",
"react": "^16.14.0",
"react": "^17.0.1",
"react-clipboard.js": "^2.0.16",
"react-dom": "^16.14.0",
"react-feather": "^2.0.8",
"react-dom": "^17.0.1",
"react-feather": "^2.0.9",
"react-helmet": "^6.1.0",
"react-pose": "^4.0.10",
"react-qr-svg": "^2.3.0",
@ -88,51 +87,51 @@
"use-dark-mode": "^2.3.1"
},
"devDependencies": {
"@babel/node": "^7.12.6",
"@babel/preset-typescript": "^7.12.1",
"@svgr/webpack": "^5.4.0",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.2",
"@babel/node": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
"@svgr/webpack": "^5.5.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.3",
"@types/classnames": "^2.2.11",
"@types/jest": "^26.0.15",
"@types/jest": "^26.0.20",
"@types/loadable__component": "^5.13.1",
"@types/lunr": "^2.3.3",
"@types/node": "^14.14.7",
"@types/node-fetch": "^2.5.7",
"@types/react": "^16.9.56",
"@types/react-dom": "^16.9.9",
"@types/node": "^14.14.22",
"@types/node-fetch": "^2.5.8",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"@types/react-helmet": "^6.1.0",
"@types/react-transition-group": "^4.4.0",
"@types/shortid": "^0.0.29",
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"@welldone-software/why-did-you-render": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"@welldone-software/why-did-you-render": "^6.0.5",
"babel-eslint": "^10.1.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.2.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-graphql": "^4.0.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-testing-library": "^3.10.0",
"fs-extra": "^9.0.1",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.13",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-testing-library": "^3.10.1",
"fs-extra": "^9.1.0",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.20",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"markdownlint-cli": "^0.24.0",
"markdownlint-cli": "^0.26.0",
"node-iptc": "^1.0.5",
"node-sass": "^4.14.1",
"npm-run-all": "^4.1.5",
"ora": "^5.1.0",
"prettier": "^2.1.2",
"ora": "^5.3.0",
"prettier": "^2.2.1",
"shortid": "^2.2.16",
"stylelint": "^13.7.2",
"stylelint": "^13.9.0",
"stylelint-config-css-modules": "^2.2.0",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^20.0.0",
"stylelint-prettier": "^1.1.2",
"typescript": "^4.0.5"
"typescript": "^4.1.3"
},
"repository": {
"type": "git",

View File

@ -5,7 +5,6 @@
# AWS_SECRET_ACCESS_KEY
# AWS_DEFAULT_REGION
AWS_S3_BUCKET="kremalicious.com"
AWS_S3_BUCKET_BETA="beta.kremalicious.com"
SITEMAP_URL="https%3A%2F%2Fkremalicious.com%2Fsitemap.xml"
#
@ -47,36 +46,10 @@ function s3sync {
--acl public-read
}
##
## check for pull request against main
##
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "main" ]; then
s3sync $AWS_S3_BUCKET
s3sync $AWS_S3_BUCKET_BETA
##
## check for main push which is no pull request
##
elif [ "$TRAVIS_BRANCH" == "main" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] || [ "$TRAVIS" != true ]; then
s3sync $AWS_S3_BUCKET
# ping search engines
# returns: HTTP_STATUSCODE URL
curl -sL -w "%{http_code} %{url_effective}\\n" \
"http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \
"http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null
echo "---------------------------------------------"
echo " ✓ done deployment "
echo "---------------------------------------------"
exit;
else
echo "---------------------------------------------"
echo " nothing to deploy "
echo "---------------------------------------------"
fi
# ping search engines
# returns: HTTP_STATUSCODE URL
curl -sL -w "%{http_code} %{url_effective}\\n" \
"http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \
"http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null

View File

@ -10,9 +10,9 @@ declare module '*.module.scss' {
declare module '*.svg' {
import * as React from 'react'
export const ReactComponent: React.FunctionComponent<React.SVGProps<
SVGSVGElement
>>
export const ReactComponent: React.FunctionComponent<
React.SVGProps<SVGSVGElement>
>
const src: string
export default src
}

Binary file not shown.