Skip to content

Merge pull request #6 from Khady/patch-1 #11

Merge pull request #6 from Khady/patch-1

Merge pull request #6 from Khady/patch-1 #11

Workflow file for this run

name: Build master - Deploy to GitHub Pages and publish npm
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install esy
run: npm install -g esy
- name: Install
run: esy install
- name: Print esy cache
id: print_esy_cache
run: node .github/workflows/print_esy_cache.js
- name: Try to restore dependencies cache
id: deps-cache
uses: actions/cache@v1
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: ubuntu-latest-4.09-${{ hashFiles('**/index.json') }}
- name: Build
run: esy build
- name: Test with coverage
run: node .github/workflows/test_with_coverage.js
- name: Build docs
run: esy docs
- name: Print docs path
id: print_docs_path
run: node .github/workflows/print_docs_path.js
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
CLEAN: true
FOLDER: ${{ steps.print_docs_path.outputs.docs_path }}
opam:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml:
- 4.10.0
- 4.09.1
- 4.08.1
- 4.07.1
fail-fast: false
steps:
- uses: actions/checkout@master
- uses: avsm/setup-ocaml@master
with:
ocaml-version: ${{ matrix.ocaml }}
- run: opam lint
- run: |
opam pin add cookie.dev -n . -k path
opam pin add session-cookie.dev -n . -k path
opam pin add session-cookie-async.dev -n . -k path
opam pin add session-cookie-lwt.dev -n . -k path
- run: opam depext -y
- run: opam install -y --deps-only --with-test .
- run: opam exec -- dune build --root=.
- run: opam exec -- dune build --root=. @runtest
publish-to-npm:
needs: build-and-deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
ref: ${{ github.ref }}
submodules: true
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Install esy
run: npm install -g esy
- name: Publish packages
run: node .github/workflows/publish_to_npm.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}