From 8a7b85dd0af3d396a536ef99361628e4cf67c70c Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 5 Mar 2021 15:41:57 -0500 Subject: [PATCH 1/2] chore: deploy docs on a release --- .github/workflows/docs.yaml | 27 +++++++++++++++++++++++++++ .github/workflows/lint.yaml | 2 +- README.md | 8 ++++---- package.json | 3 ++- 4 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 00000000..c5aaba12 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,27 @@ +name: Deploy API Documentation + +on: + release: + types: [published] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 + + - name: Install root dependencies + run: npm install --ignore-scripts + + - name: Build 🔧 + run: | + npm run compile + npm run docs + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: docs/out # The folder the action should deploy. \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c27b95ef..7e47e051 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -37,4 +37,4 @@ jobs: run: npm run docs - name: Test Docs - run: npm run docs-test + run: npm run docs:test diff --git a/README.md b/README.md index eea8b287..b0b00441 100644 --- a/README.md +++ b/README.md @@ -162,10 +162,10 @@ Apache 2.0 - See [LICENSE][license-url] for more information. [npm-url]: https://www.npmjs.com/package/@opentelemetry/api [npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg -[trace-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/traceapi.html -[metrics-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/metricsapi.html -[propagation-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/propagationapi.html -[context-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/contextapi.html +[trace-api-docs]: https://open-telemetry.github.io/opentelemetry-js-api/classes/traceapi.html +[metrics-api-docs]: https://open-telemetry.github.io/opentelemetry-js-api/classes/metricsapi.html +[propagation-api-docs]: https://open-telemetry.github.io/opentelemetry-js-api/classes/propagationapi.html +[context-api-docs]: https://open-telemetry.github.io/opentelemetry-js-api/classes/contextapi.html [web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-web [tracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-tracing diff --git a/package.json b/package.json index cf6df38d..cdfdde89 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p .", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p .", "compile": "tsc --build", - "docs-test": "linkinator docs/out --silent --skip david-dm.org", "docs": "typedoc", + "docs:deploy": "gh-pages --dist docs/out", + "docs:test": "linkinator docs/out --silent --skip david-dm.org", "lint:fix": "eslint src test --ext .ts --fix", "lint": "eslint src test --ext .ts", "test:browser": "nyc karma start --single-run", From 4d7981e77c0cb488b80f5986da743c5796d8eab1 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 10 Mar 2021 10:28:26 -0500 Subject: [PATCH 2/2] chore: add empty line --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index c5aaba12..4dae75bb 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -24,4 +24,4 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs/out # The folder the action should deploy. \ No newline at end of file + FOLDER: docs/out # The folder the action should deploy.