-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Build GitHub Pages bundle on-the-fly
Builds all the JS and CSS files required for the demo pages in `gh-pages.yml` via GitHub Actions. Removes the necessity of having the JS bundles at `/docs/demos/dist`, as they will be compiled on every commit to `main`. Please confirm that, under Settings > Pages > Build and deployment (https://github.com/fiduswriter/simple-datatables/settings/pages), the "Source" field is set to "GitHub Actions". I have checked out `package-lock.json` to make builds deterministic - building the library now or building it in ten months should generate the same code and dependency tree.
- Loading branch information
Showing
11 changed files
with
6,710 additions
and
5,874 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,53 @@ | ||
name: Update docs | ||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- name: Build JS bundle | ||
run: npm ci | ||
- name: Build site | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./docs | ||
destination: ./_site | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
|
||
# Deployment job | ||
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 |
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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
name: simple-datatables CI | ||
name: Check lints | ||
|
||
on: [push] | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- run: npm install | ||
- run: npm run lint | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Lints | ||
run: npm run lint |
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
name: simple-datatables CI | ||
name: Check tests | ||
|
||
on: [push] | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: sudo apt update && sudo apt install -y google-chrome-stable | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Chrome | ||
run: sudo apt update && sudo apt install -y google-chrome-stable | ||
- run: /usr/bin/google-chrome-stable --version | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- run: npm install | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- uses: jamesmortensen/chromedriver-matcher-action@v1 | ||
- run: npm test | ||
- name: Tests | ||
run: npm test |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/dist/ | ||
/docs/demos/dist/ | ||
node_modules/ | ||
tests/qunit.css | ||
package-lock.json | ||
.DS_Store | ||
.idea/ | ||
.python-version | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.