Skip to content

Commit

Permalink
Publish Docs to The NPM Registry (#1760)
Browse files Browse the repository at this point in the history
* reorganize docs.

* install zio-sbt-website plugin.

* update ci.

* update readme.
  • Loading branch information
khajavi authored Nov 10, 2022
1 parent 28ad22a commit ac2bf3c
Show file tree
Hide file tree
Showing 67 changed files with 46 additions and 8,483 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,22 @@ jobs:
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
fetch-depth: 0

- name: Setup Scala and Java
uses: olafurpg/setup-scala@v13

- uses: actions/setup-node@v3
with:
node-version: 16.15.1
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- env:
GIT_PASS: ${{secrets.ACTIONS_PAT}}
GIT_USER: ${{secrets.GIT_USER}}
run: |
cd ./docs/website
npm install
git config --global user.name "${{secrets.GIT_USER}}"
npm run deploy
- name: Publishing Docs to NPM Registry
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: sbt publishToNpm

unsafeRunScoverage:
name: Unsafe Scoverage
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ZIO Http is a scala library for building http apps. It is powered by [ZIO] and [

Check out the full documentation here: [Documentation]

[Documentation]: https://zio.github.io/zio-http
[Documentation]: https://zio.dev/zio-http

![Continuous Integration](https://github.com/zio/zio-http/workflows/Continuous%20Integration/badge.svg)
[![Discord Chat](https://img.shields.io/discord/629491597070827530.svg?logo=discord)](https://discord.com/channels/629491597070827530/819703129267372113)
Expand All @@ -21,7 +21,7 @@ Check out the full documentation here: [Documentation]
- [ZIO Http](#zio-http)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Documentation](https://zio.github.io/zio-http/)
- [Documentation](https://zio.dev/zio-http/)

# Getting Started

Expand Down
18 changes: 10 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@ ThisBuild / githubWorkflowAddedJobs :=
id = "update_docs",
name = "Publish Documentation",
steps = List(
WorkflowStep.Use(UseRef.Public("actions", "checkout", s"v2")),
WorkflowStep
.Use(UseRef.Public("actions", "checkout", "v3.1.0"), Map("fetch-depth" -> "0")),
WorkflowStep.Use(name = Some("Setup Scala and Java"), ref = UseRef.Public("olafurpg", "setup-scala", "v13")),
WorkflowStep.Use(
UseRef.Public("actions", "setup-node", s"v3"),
UseRef.Public("actions", "setup-node", "v3"),
Map(
"node-version" -> "16.15.1",
"node-version" -> "16.x",
"registry-url" -> "https://registry.npmjs.org"
),
),
WorkflowStep.Run(
env = Map("GIT_PASS" -> "${{secrets.ACTIONS_PAT}}", "GIT_USER" -> "${{secrets.GIT_USER}}"),
name = Some("Publishing Docs to NPM Registry"),
env = Map("NODE_AUTH_TOKEN" -> "${{secrets.NPM_TOKEN}}"),
commands = List(
"cd ./docs/website",
"npm install",
"git config --global user.name \"${{secrets.GIT_USER}}\"",
"npm run deploy",
"sbt publishToNpm"
),
),
),
Expand Down Expand Up @@ -101,6 +102,7 @@ lazy val root = (project in file("."))
zioHttpExample,
zioHttpTestkit,
)
.enablePlugins(WebsitePlugin)

lazy val zioHttp = (project in file("zio-http"))
.settings(stdSettings("zio-http"))
Expand Down
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

6 changes: 6 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
sidebar_position: 1
title: "Introduction to ZIO Http"
sidebar_label: "Introduction"
---

**Table of Contents**

- [Http](#http)
Expand Down
5 changes: 5 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@zio.dev/zio-http",
"description": "ZIO Http Documentation",
"license": "Apache-2.0"
}
8 changes: 8 additions & 0 deletions docs/sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
};

module.exports = sidebars;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions docs/website/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions docs/website/babel.config.js

This file was deleted.

83 changes: 0 additions & 83 deletions docs/website/docusaurus.config.js

This file was deleted.

40 changes: 0 additions & 40 deletions docs/website/package.json

This file was deleted.

20 changes: 0 additions & 20 deletions docs/website/sidebars.js

This file was deleted.

60 changes: 0 additions & 60 deletions docs/website/src/components/HomepageFeatures.js

This file was deleted.

11 changes: 0 additions & 11 deletions docs/website/src/components/HomepageFeatures.module.css

This file was deleted.

28 changes: 0 additions & 28 deletions docs/website/src/css/custom.css

This file was deleted.

Loading

0 comments on commit ac2bf3c

Please sign in to comment.