Skip to content

Commit 8925f21

Browse files
klntskyf-f
andauthored
Switch CI to GitHub Actions (#48)
Co-authored-by: Fabrizio Ferrai <[email protected]>
1 parent 962fa47 commit 8925f21

File tree

4 files changed

+1086
-52
lines changed

4 files changed

+1086
-52
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: "14"
16+
17+
- uses: purescript-contrib/setup-purescript@main
18+
19+
- uses: actions/cache@v2
20+
with:
21+
path: ~/.npm
22+
key: ${{ runner.os }}-node-${{ hashFiles('./**/package-lock.json') }}
23+
restore-keys: |
24+
${{ runner.os }}-node-
25+
26+
- name: Cache PureScript dependencies
27+
uses: actions/cache@v2
28+
with:
29+
key: ${{ runner.os }}-spago-${{ hashFiles('./**/*.dhall') }}
30+
path: |
31+
.spago
32+
output
33+
34+
- name: Install
35+
run: |
36+
npm ci
37+
spago install
38+
39+
- name: Build
40+
run: |
41+
npm run build
42+
npm test
43+
spago docs --no-search
44+
./dist/purescript-docs-search build-index

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: "14"
15+
16+
- uses: purescript-contrib/setup-purescript@main
17+
18+
- uses: actions/cache@v2
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-node-${{ hashFiles('./**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-node-
24+
25+
- name: Cache PureScript dependencies
26+
uses: actions/cache@v2
27+
with:
28+
key: ${{ runner.os }}-spago-${{ hashFiles('./**/*.dhall') }}
29+
path: |
30+
.spago
31+
output
32+
33+
- name: Build
34+
run: |
35+
npm ci
36+
spago install
37+
npm run build
38+
39+
- name: Release
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
files: |
43+
dist/docs-search-app.js
44+
dist/purescript-docs-search
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Publish to NPM
49+
shell: bash
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_TOKEN }}
52+
run: npm publish --non-interactive --access public

.travis.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)