diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a0078b56 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..7bbb44a4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/tools/deploy-gh-pages.js b/tools/deploy-gh-pages.js index e02b9525..2129cb21 100644 --- a/tools/deploy-gh-pages.js +++ b/tools/deploy-gh-pages.js @@ -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(); });