-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge website code from nightwatch-www repo (#288)
* Added website files * fixed internal links
- Loading branch information
1 parent
31ba9d3
commit 4b93a45
Showing
613 changed files
with
38,345 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'preview' | ||
- 'versions/3.0-complete' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
BASE_URL: https://dev.nightwatchjs.org | ||
REMOTE_SERVER: ${{ secrets.REMOTE_SERVER }} | ||
REMOTE_USER: ${{ secrets.REMOTE_USER }} | ||
API_DOCS_FOLDER: ${{ github.workspace }}/nightwatch/lib/api | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Checkout Nightwatch source code | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: nightwatchjs/nightwatch | ||
path: nightwatch | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the website | ||
run: npm run build | ||
|
||
- name: Creating symlinks to old version | ||
run: | | ||
ln -s ../nightwatchjs.org out/v17 | ||
ln -s ../v09.nightwatchjs.org out/v09 | ||
ln -s ../nightwatch-v26 out/v26 | ||
- name: Deploy to server | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.PROD_DEPLOY_SECRET }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan ${{ env.REMOTE_SERVER }} >> ~/.ssh/known_hosts | ||
rsync -azP --delete ./out/ ${{ env.REMOTE_USER }}@${{ env.REMOTE_SERVER }}:${{ secrets.REMOTE_PREVIEW_DIRECTORY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import {generate} from 'critical'; | ||
import {minify} from 'html-minifier'; | ||
import {readFileSync, writeFileSync} from 'fs'; | ||
import path from 'path'; | ||
|
||
// Inline critical CSS | ||
generate({ | ||
inline: true, | ||
base: 'out/', | ||
src: 'index.html', | ||
target: { | ||
html: 'index.html', | ||
uncritical: 'css/landing/style.css' | ||
}, | ||
dimensions: [ | ||
{ | ||
height: 200, | ||
width: 500 | ||
}, | ||
{ | ||
height: 900, | ||
width: 1024 | ||
}, | ||
{ | ||
height: 900, | ||
width: 1400 | ||
} | ||
], | ||
// ignore CSS rules | ||
ignoreInlinedStyles: true | ||
}).then(({css, html, uncritical}) => { | ||
console.log('Critical CSS generated', css.length); | ||
console.log('Uncritical CSS generated', uncritical.length); | ||
}).catch(err => { | ||
console.error('Critical CSS generation failed', err); | ||
}).then(() => { | ||
// Minify HTML | ||
const htmlPath = path.resolve('out/index.html'); | ||
const htmlContent = readFileSync(htmlPath, 'utf8'); | ||
const minifiedHTMLContent = minify(htmlContent, { | ||
collapseWhitespace: true, | ||
collapseInlineTagWhitespace: true, | ||
conservativeCollapse: true, | ||
minifyCSS: true, | ||
minifyJS: true, | ||
removeComments: true, | ||
useShortDoctype: true, | ||
html5: true | ||
}); | ||
|
||
writeFileSync(htmlPath, minifiedHTMLContent, 'utf8'); | ||
console.log('Wrote minified HTML to', htmlPath, minifiedHTMLContent.length); | ||
}); | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.