Skip to content

Commit

Permalink
Merge chore-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis committed Apr 14, 2020
2 parents 2140971 + b3938f5 commit b56c474
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ production ]

jobs:
docBuild:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- uses: borales/actions-yarn@v2.0.0
with:
cmd: docs:build
env:
CI: true
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/.vuepress/dist # The folder the action should deploy.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "yarn gulp examples:build && gulp repo:build",
"publish:dryRun": "yarn build && gulp repo:publishDryRun",
"docs:serve": "yarn api:build && yarn vuepress:serve ",
"docs:build": "yarn api:build && yarn vuepress:build ",
"docs:build": "yarn api:build && yarn vuepress:build && gulp docs:cnameBuild",
"docs:publish": "yarn docs:build && gulp docs:publish",
"examples:build": "gulp examples:build",
"examples:publish": "gulp examples:publish",
Expand Down Expand Up @@ -174,4 +174,4 @@
"packages/*"
]
}
}
}
13 changes: 10 additions & 3 deletions tasks/gulp/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ const {doc} = require("../../repo.config");
const {branch} = require("../../release.config");

module.exports = {
async cnameBuild() {
const {cname} = doc;
const vuePressPath = "./docs/.vuepress/dist";

fs.writeFileSync(`${vuePressPath}/CNAME`, cname, {});
},

async publish() {
if (doc.publish) {
const currentBranch = process.env.TRAVIS_BRANCH;
Expand All @@ -19,14 +26,14 @@ module.exports = {

const pkg = JSON.parse(fs.readFileSync("./package.json", {encoding: "utf8"}));
const {version} = pkg;
const {url, cname, branch: branchDoc} = doc;
const {url, branch: branchDoc} = doc;

const {GH_TOKEN} = process.env;
const repository = url.replace("https://", "");

const vuePressPath = "./docs/.vuepress/dist";
await exports.cnameBuild();

fs.writeFileSync(`${vuePressPath}/CNAME`, cname, {});
const vuePressPath = "./docs/.vuepress/dist";

try {
await execa("git", ["init"], {
Expand Down
7 changes: 7 additions & 0 deletions tsdoc.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ module.exports = {
packagesDir: "packages/",
scanPatterns: [
"<rootDir>/packages/**/lib/**/*.d.ts",
"!<rootDir>/packages/**/lib/**/data/*.ts",
"!<rootDir>/packages/seq",
"!<rootDir>/packages/test-artillery",
"!<rootDir>/packages/servestatic",
"!<rootDir>/packages/testing/{bootstrap,inject,invoke,loadInjector}.ts",
"!<rootDir>/packages/integration",
"!<rootDir>/packages/integration-express",
"!node_modules"
],
outputDir: "<rootDir>/docs/api",
Expand Down

0 comments on commit b56c474

Please sign in to comment.