add basic Jenkinsfile for deploying to GitHub Pages

This commit is contained in:
Jakub Sokołowski 2018-07-23 12:02:23 +02:00
parent e4a1684173
commit 135ccd3820
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
7 changed files with 1923 additions and 1762 deletions

32
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,32 @@
def gh_user = 'status-im-auto'
def gh_email = 'auto@status.im'
node('linux') {
environment {
GH_USER = gh_user
}
stage('Git Prep') {
checkout scm
sh "git config user.name ${gh_user}"
sh "git config user.email ${gh_email}"
}
stage('Install Deps') {
sh 'npm install'
}
stage('Build') {
sh 'npm run lint'
sh 'npm run prod-build'
}
stage('Publish') {
withCredentials([string(
credentialsId: 'jenkins-github-token',
variable: 'GH_TOKEN',
)]) {
sh 'npm run gh-publish'
}
}
}

View File

@ -2,12 +2,14 @@
ETHPrize single page React website
## Setting up
- `git clone git@github.com:Nona-Creative/ETHPrize.git`
- `git clone git@github.com:status-im/ETHPrize.git`
- `npm install`
- `npm run dev` runs the site at `localhost:3000`
- `yarn lint` runs the eslinter
## Deploy to staging
- `npm run deploy` to deploy
- This pushes the compiled code to a second repo at `https://github.com/Nona-Creative/nona-creative.github.io-ETHprize`
- View staging Github page at `https://nona-creative.github.io/nona-creative.github.io-ETHprize`
## Deploy
- `npm run prod-build` to build to the `out` directory
- `npm run gh-publish` to deploy to GitHub Pages
- This pushes the compiled code to the `gh-pages` branch
- View staging Github page at: https://status-im.github.io/ETHReport/

View File

@ -1,11 +1,11 @@
@font-face {
font-family: 'bebas_neuebold';
src: url('/nona-creative.github.io-ETHprize/static/fonts/bebasneue_bold-webfont.eot');
src: url('/nona-creative.github.io-ETHprize/static/fonts/bebasneue_bold-webfont.eot?#iefix') format('embedded-opentype'),
url('/nona-creative.github.io-ETHprize/static/fonts/bebasneue_bold-webfont.woff2') format('woff2'),
url('/nona-creative.github.io-ETHprize/static/fonts/bebasneue_bold-webfont.woff') format('woff'),
url('/nona-creative.github.io-ETHprize/static/fonts/bebasneue_bold-webfont.ttf') format('truetype'),
url('/nona-creative.github.io-ETHprize/static/fonts/bebasneue_bold-webfont.svg#bebas_neuebold') format('svg');
src: url('/ETHReport/static/fonts/bebasneue_bold-webfont.eot');
src: url('/ETHReport/static/fonts/bebasneue_bold-webfont.eot?#iefix') format('embedded-opentype'),
url('/ETHReport/static/fonts/bebasneue_bold-webfont.woff2') format('woff2'),
url('/ETHReport/static/fonts/bebasneue_bold-webfont.woff') format('woff'),
url('/ETHReport/static/fonts/bebasneue_bold-webfont.ttf') format('truetype'),
url('/ETHReport/static/fonts/bebasneue_bold-webfont.svg#bebas_neuebold') format('svg');
font-weight: normal;
font-style: normal;
}

15
bin/gh-pages.js Executable file
View File

@ -0,0 +1,15 @@
var ghpages = require('gh-pages')
ghpages.publish('out', {
repo: (
'https://'
+ process.env.GH_USER + ':'
+ process.env.GH_TOKEN
+ '@github.com/status-im/ETHReport.git'
),
branch: 'gh-pages',
dotfiles: true,
silent: false
}, function(err) {
if (err) { console.error(err) }
})

View File

@ -1,7 +1,7 @@
const withSass = require('@zeit/next-sass');
const dev = process && process.env && process.env.NODE_ENV === 'development';
const subDirPath = dev ? '' : '/nona-creative.github.io-ETHprize';
const subDirPath = dev ? '' : '/ETHReport';
module.exports =
withSass({

3584
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "ETHPrize",
"name": "ETHReport",
"version": "1.0.0",
"description": "ETHPrize website",
"description": "ETHReport website",
"main": "index.js",
"scripts": {
"dev": "npm run transform && next",
@ -9,33 +9,20 @@
"start": "npm run transform && next start",
"serve": "npm run transform && next build && next start",
"prod-build": "npm run transform && next build && next export && touch out/.nojekyll",
"deploy": "deploy-to-git && rm -rf out",
"gh-publish": "node bin/gh-pages.js",
"lint": "eslint \"components/**/*.js\" \"pages/*.js\"\"data/**/*.js\"",
"transform": "node bin/transform-json"
},
"config": {
"deployToGit": {
"repository": "git@github.com:Nona-Creative/nona-creative.github.io-ETHprize.git",
"branch": "master",
"folder": "out",
"script": "npm run prod-build",
"commit": "Deploy github pages",
"user": {
"email": "deploy@nonacreative.com",
"name": "deploy"
}
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/Nona-Creative/ETHPrize.git"
"url": "git+https://github.com/status-im/ETHReport.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Nona-Creative/ETHPrize/issues"
"url": "https://github.com/status-im/ETHReport/issues"
},
"homepage": "https://github.com/Nona-Creative/ETHPrize#readme",
"homepage": "https://github.com/status-im/ETHPrize#readme",
"dependencies": {
"@zeit/next-sass": "^0.2.0",
"html-react-parser": "^0.4.5",
@ -56,6 +43,7 @@
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.9.1"
"eslint-plugin-react": "^7.9.1",
"gh-pages": "^1.2.0"
}
}