diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000000..a77c74ce29 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,45 @@ +name: GitHub Pages Deploy + +# Only run workflow when triggered manually from Actions tab +on: workflow_dispatch + +# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - run: sudo gem install bundler -v 2.1.4 + - run: npm run install-jekyll + - run: BUILD=1 npm run build-site + - name: upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: docs/_site + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000000..8a3b5612f1 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pouchdb.com diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a4e536a8d..72d3cc296b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -164,7 +164,7 @@ Release Procedure * Copy the `dist/pouchdb*` files from the $VERSION tag on github, paste the release notes and add the distribution files to Github Releases, rename `pouchdb.min.js` to `pouchdb-$VERSION.min.js` (same with `pouchdb.js`) after you upload it. * Update docs/_config.yml to the current version * Push updated versions to master - * `npm run publish-site` + * in https://github.com/pouchdb/pouchdb/actions, trigger the "Github Pages Deploy" workflow To do a dry run release, you can run: diff --git a/bin/publish-site.sh b/bin/publish-site.sh deleted file mode 100755 index 6c429e7f32..0000000000 --- a/bin/publish-site.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -e - -# Build the website -BUILD=1 npm run build-site - -# Push the site live, requires credentials, open a bug -# if you need to be able to push the site -rsync --recursive --progress docs/_site/* pouchdb@pouchdb.com:/home/pouchdb/www/pouchdb.com/ diff --git a/package.json b/package.json index a283289395..3dff3ca803 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "prepublish": "npm run build", "release": "./bin/release.sh", "install-jekyll": "./bin/install-jekyll.sh", - "publish-site": "./bin/publish-site.sh", "build-site": "node ./bin/build-site.js", "test-coverage": "./bin/test-coverage.sh", "coverage": "COVERAGE=1 SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find ./bin/test-coverage.sh",