Add action fro docs.

master
Hasan Genc 3 years ago
parent aa20f114fa
commit 051af4ba6d
  1. 50
      .github/workflows/documentation.yml
  2. 3
      website/docusaurus.config.js
  3. 1
      website/package.json

@ -0,0 +1,50 @@
name: documentation
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Test Build
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Release to GitHub Pages
env:
USE_SSH: false
GIT_USER: ${{ secrets.GIT_USER }}
run: |
git config --global user.email "${{ secrets.GIT_MAIL }}"
git config --global user.name "${{ secrets.GIT_USER }}"
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run deploy

@ -6,7 +6,6 @@ module.exports = {
favicon: 'img/icon.png', favicon: 'img/icon.png',
organizationName: 'Trendyol', organizationName: 'Trendyol',
projectName: 'react-carousel', projectName: 'react-carousel',
plugins: ['@docusaurus/plugin-google-analytics'],
themeConfig: { themeConfig: {
googleAnalytics: { googleAnalytics: {
trackingID: 'UA-163119464-1', trackingID: 'UA-163119464-1',
@ -17,7 +16,7 @@ module.exports = {
alt: 'Carousel', alt: 'Carousel',
src: 'img/icon.png', src: 'img/icon.png',
}, },
links: [ items: [
{ {
to: 'docs/installation', to: 'docs/installation',
activeBasePath: 'docs', activeBasePath: 'docs',

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"@docusaurus/core": "^2.0.0-alpha.48", "@docusaurus/core": "^2.0.0-alpha.48",
"@docusaurus/preset-classic": "^2.0.0-alpha.48", "@docusaurus/preset-classic": "^2.0.0-alpha.48",
"@trendyol-js/react-carousel": "^2.0.0",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"react": "^16.13.1", "react": "^16.13.1",
"react-dom": "^16.13.1" "react-dom": "^16.13.1"

Loading…
Cancel
Save