Skip to content

Commit 1ed37a5

Browse files
committed
Test gh-pages
1 parent 29cbc8b commit 1ed37a5

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ jobs:
2222
uses: actions/cache@v2
2323
with:
2424
path: ~/.npm
25-
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: v1-npm-deps-
25+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-node-
2728
- run: npm ci
2829
- run: npm install -g mongodb-runner
2930
- run: mongodb-runner start

.github/workflows/pages.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: docs
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- '**'
9+
jobs:
10+
build:
11+
runs-on: ubuntu-18.04
12+
timeout-minutes: 30
13+
steps:
14+
- name: Get Tag
15+
id: tag
16+
run: |
17+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
18+
- name: Generate Docs
19+
run: |
20+
echo $SOURCE_TAG
21+
npm run release_docs
22+
env:
23+
SOURCE_TAG: ${{ steps.tag.outputs.SOURCE_TAG }}
24+
- name: Deploy
25+
uses: peaceiris/[email protected]
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish_dir: ./docs

release_docs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh -e
22
set -x
3-
if [ "${TRAVIS_REPO_SLUG}" = "" ];
3+
if [ "${GITHUB_ACTIONS}" = "" ];
44
then
5-
echo "Cannot release docs without TRAVIS_REPO_SLUG set"
5+
echo "Cannot release docs without GITHUB_ACTIONS set"
66
exit 0;
77
fi
8-
REPO="https://github.com/${TRAVIS_REPO_SLUG}"
8+
REPO="https://github.com/parse-community/Parse-SDK-JS"
99

1010
rm -rf docs
1111
git clone -b gh-pages --single-branch $REPO ./docs
@@ -15,9 +15,9 @@ cd ..
1515

1616
DEST="master"
1717

18-
if [ "${TRAVIS_TAG}" != "" ];
18+
if [ "${SOURCE_TAG}" != "" ];
1919
then
20-
DEST="${TRAVIS_TAG}"
20+
DEST="${SOURCE_TAG}"
2121
# change the default page to the latest
2222
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${DEST}'>" > "docs/api/index.html"
2323
fi

0 commit comments

Comments
 (0)