Skip to content

Commit 688398d

Browse files
author
alxndrsn
committed
wip: Publish site with GitHub Pages
1 parent 24ed2a3 commit 688398d

File tree

5 files changed

+48
-12
lines changed

5 files changed

+48
-12
lines changed

.github/workflows/github-pages.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: GitHub Pages Deploy
2+
3+
# Only run workflow when triggered manually from Actions tab
4+
on: workflow_dispatch
5+
6+
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
# Allow only one concurrent deployment
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
- uses: ./.github/actions/install-deps
24+
- uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: 2.7
27+
bundler-cache: true
28+
- run: sudo gem install bundler -v 2.1.4
29+
- run: npm run install-jekyll
30+
- run: BUILD=1 npm run build-site
31+
- name: upload artifact
32+
uses: actions/upload-pages-artifact@v2
33+
with:
34+
path: docs/_site
35+
36+
deploy:
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
runs-on: ubuntu-latest
41+
needs: build
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v2

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pouchdb.com

bin/build-site.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
'use strict';
44

5+
var http_server = require('http-server');
56
var fs = require('fs');
7+
var watchGlob = require('watch-glob');
68
var replace = require('replace');
79
var exec = require('child-process-promise').exec;
810
var mkdirp = require('mkdirp');
@@ -70,9 +72,6 @@ function buildEverything() {
7072
}
7173

7274
if (!process.env.BUILD) {
73-
const http_server = require('http-server');
74-
const watchGlob = require('watch-glob');
75-
7675
watchGlob('**', buildJekyll);
7776
watchGlob('docs/static/less/*/*.less', buildCSS);
7877
http_server.createServer({root: '_site', cache: '-1'}).listen(4000);

bin/publish-site.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"prepublish": "npm run build",
2222
"release": "./bin/release.sh",
2323
"install-jekyll": "./bin/install-jekyll.sh",
24-
"publish-site": "./bin/publish-site.sh",
2524
"build-site": "node ./bin/build-site.js",
2625
"test-coverage": "./bin/test-coverage.sh",
2726
"coverage": "COVERAGE=1 SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find ./bin/test-coverage.sh",

0 commit comments

Comments
 (0)