Skip to content

Commit

Permalink
build: introduce GH actions (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
petermuessig authored Jan 2, 2024
1 parent 1928598 commit c7c6101
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Build and validate the content"

on:
pull_request:
branches: [main]

env:
HUSKY_SKIP: true

jobs:
build:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Build and validate all steps
run: node tools/prepare-gh-pages.js
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Deploy to GH pages"

on:
push:
branches: [main]

env:
HUSKY_SKIP: true

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install dependencies
run: npm install

- name: Build and validate all steps
run: node tools/prepare-gh-pages.js

- name: Deploy to GH pages
run: node tools/deploy-gh-pages.js
3 changes: 2 additions & 1 deletion tools/deploy-gh-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const ghpages = require("gh-pages");

await new Promise(function(resolve, reject) {
ghpages.publish("dist", {
nojekyll: true
nojekyll: true,
history: false
}, function() {
resolve();
});
Expand Down

0 comments on commit c7c6101

Please sign in to comment.