Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 8181820

Browse files
committed
Move java/scaladoc deploying from Travis to GitHub Actions
1 parent 079d96c commit 8181820

File tree

3 files changed

+32
-33
lines changed

3 files changed

+32
-33
lines changed

.github/workflows/doc-deploy.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Javadoc Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
publish:
10+
if: startsWith(github.repository, "codeoverflow-org") # don't run this in forks
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Clone API
15+
run: git clone https://github.com/codeoverflow-org/chatoverflow-api --branch master --single-branch --depth 1 api
16+
- uses: olafurpg/setup-scala@v5
17+
name: Install java & sbt
18+
with:
19+
java-version: [email protected]
20+
21+
- name: Generate documentation
22+
run: sbt -Dfile.encoding=UTF8 fetch reload update doc
23+
24+
- name: Publish documentation
25+
run: bash .scripts/update-docs.sh
26+
env:
27+
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
28+

.scripts/update-docs.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
#!/bin/bash
22
set -ev
3-
SCALA_MAJOR=$(echo $TRAVIS_SCALA_VERSION | egrep '^[0-9]+\.[0-9]+' -o)
43

54
# Update the java-/scaladocs on https://github.com/codeoverflow-org/chatoverflow-gh-pages
65

7-
echo "Configuring git..."
8-
git config --global user.email "[email protected]"
9-
git config --global user.name "Travis CI"
10-
116
echo "Cloning docs repo..."
12-
git clone https://${GH_TOKEN}@github.com/codeoverflow-org/chatoverflow-gh-pages --branch master --single-branch --depth 1 docs
7+
git clone https://${REPO_TOKEN}@github.com/codeoverflow-org/chatoverflow-gh-pages --branch master --single-branch --depth 1 docs
138

149
echo "Copying docs..."
15-
cp -fR target/scala-$SCALA_MAJOR/api docs/chatoverflow
16-
cp -fR api/target/scala-$SCALA_MAJOR/api docs/chatoverflow-api
10+
cp -fR target/scala-*/api docs/chatoverflow
11+
cp -fR api/target/scala-*/api docs/chatoverflow-api
1712
cd docs
1813

1914
echo "Updating wiki..."
2015
git add .
21-
git commit --message "Deployed doc (Travis build #$TRAVIS_BUILD_NUMBER)"
16+
git commit --message "Deployed doc (Action build $GITHUB_ACTION)"
2217
git push --force origin master

.travis.yml

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

0 commit comments

Comments
 (0)