Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbaileyuk committed Feb 29, 2024
1 parent 8e4abd8 commit ebdb02a
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/jsonata.yml
@@ -0,0 +1,68 @@
name: Build and publish JSONata
on:
push:
branches: [ master, v1 ]
pull_request:
branches: [ master, v1 ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
publish:
needs: build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.repository == 'jsonata-js/jsonata' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install and build
run: npm install && npm test
- name: Publish to NPM
id: npmpub
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- if: steps.npmpub.outputs.type != 'none'
run: |
echo "Version changed: ${{ steps.npmpub.outputs.old-version }} => ${{ steps.npmpub.outputs.version }}"
documentation:
needs: build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.repository == 'jsonata-js/jsonata' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Build documentation
run: |
cd website
npm install
npm run build
- name: Deploy to GitHub Pages
if: success()
run: |
cd website
git config --global user.name "andrew-coleman"
git config --global user.email "andrew_coleman@uk.ibm.com"
echo "machine github.com login andrew-coleman password ${{ secrets.DOCS_AUTH }}" > ~/.netrc
npm run publish-gh-pages
env:
GIT_USER: andrew-coleman

0 comments on commit ebdb02a

Please sign in to comment.