Skip to content

Commit

Permalink
Added deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Mar 24, 2024
1 parent 4b93a45 commit 227f885
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build and Deploy

name: Build and Deploy to Preview
on:
push:
branches:
- 'preview'
- 'versions/3.0-complete'

jobs:
build:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Deploy

on:
push:
branches:
- 'versions/3.0'

jobs:
build:
runs-on: ubuntu-latest
env:
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_DIRECTORY }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Documentation sources for [nightwatchjs.org](http://nightwatchjs.org) website.

## Development

The docs content is written in Markdown and it is located in the `docs` folder. The individual API command pages are generated from the Nightwatch source code. based on the JSDoc comments.
The content is written in Markdown and it is located in the `docs` folder. The individual API command pages are generated from the Nightwatch source code. based on the JSDoc comments.

### Run the website locally

Expand Down

0 comments on commit 227f885

Please sign in to comment.