diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index d0d9b36a..7044df1a 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -7,13 +7,11 @@ on: - main paths: - '.github/workflows/docs-check.yml' - - '.github/workflows/docs-deploy.yml' - docs/** - website/** pull_request: paths: - '.github/workflows/docs-check.yml' - - '.github/workflows/docs-deploy.yml' - docs/** - website/** jobs: diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml deleted file mode 100644 index adb11195..00000000 --- a/.github/workflows/docs-deploy.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Docs publish -on: - push: - branches: - - main - paths: - - docs/** - - website/** - - '.github/workflows/docs-deploy.yml' - -jobs: - publish: - if: github.repository == 'AppAndFlow/react-native-safe-area-context' - runs-on: ubuntu-latest - steps: - - name: Check out - uses: actions/checkout@v4 - - - name: Use Node.js 22.13.0 - uses: actions/setup-node@v4 - with: - node-version: 22.13.0 - - - name: Build landing page and documentation - run: | - yarn --cwd website install --frozen-lockfile - yarn --cwd website build - yarn --cwd docs install --frozen-lockfile - yarn --cwd docs build - mkdir -p website/build/docs - cp -R docs/build/. website/build/docs/ - - - name: Publish generated content to GitHub Pages - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: - FOLDER: website/build - BRANCH: gh-pages - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e65e365c..b1a810e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing -See https://appandflow.github.io/react-native-safe-area-context/contributing/ +See https://rnsac.appandflow.com/docs/contributing diff --git a/README.md b/README.md index 20bbd9ca..7f7eeb5d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A flexible way to handle safe area, also works on Android and Web! ## Documentation -Check out our [documentation site](https://appandflow.github.io/react-native-safe-area-context/). +Check out our [documentation site](https://rnsac.appandflow.com/). ## Contributing diff --git a/docs/README.md b/docs/README.md index 0c6c2c27..44de505f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -26,16 +26,4 @@ This command generates static content into the `build` directory and can be serv ### Deployment -Using SSH: - -``` -$ USE_SSH=true yarn deploy -``` - -Not using SSH: - -``` -$ GIT_USER= yarn deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. +The landing page (`website/`) and these docs are deployed together to [rnsac.appandflow.com](https://rnsac.appandflow.com) by Vercel on every push to `main`, with the docs served under `/docs/`. Pull requests get a preview deployment. The build is configured in `vercel.json` at the repository root. diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index b02107ba..9c4b89fe 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -10,13 +10,11 @@ const config: Config = { favicon: 'img/favicon.ico', // Set the production url of your site here - url: 'https://appandflow.github.io', - // Set the // pathname under which your site is served - // For GitHub pages deployment, it is often '//' - baseUrl: '/react-native-safe-area-context/docs/', + url: 'https://rnsac.appandflow.com', + // The docs are served under /docs/ next to the landing page in `website/`. + // See vercel.json at the repository root. + baseUrl: '/docs/', - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. organizationName: 'AppAndFlow', // Usually your GitHub org/user name. projectName: 'react-native-safe-area-context', // Usually your repo name. diff --git a/docs/static/.nojekyll b/docs/static/.nojekyll deleted file mode 100644 index e69de29b..00000000 diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..c21c4b48 --- /dev/null +++ b/vercel.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "framework": null, + "installCommand": "yarn --cwd website install --frozen-lockfile && yarn --cwd docs install --frozen-lockfile", + "buildCommand": "yarn --cwd website build && yarn --cwd docs build && mkdir -p website/build/docs && cp -R docs/build/. website/build/docs/", + "outputDirectory": "website/build", + "ignoreCommand": "git diff --quiet HEAD^ HEAD -- website docs vercel.json" +} diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 80794a1f..24b07185 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -1,8 +1,8 @@ export default { title: 'React Native Safe Area Context', tagline: 'Simplifying layout management with React Native Safe Area Context', - url: 'https://appandflow.github.io', - baseUrl: '/react-native-safe-area-context/', + url: 'https://rnsac.appandflow.com', + baseUrl: '/', onBrokenLinks: 'throw', presets: [ ['classic', { diff --git a/website/src/landing/content.js b/website/src/landing/content.js index 9d2a8999..1daffb95 100644 --- a/website/src/landing/content.js +++ b/website/src/landing/content.js @@ -1,5 +1,5 @@ export const docs = - 'https://appandflow.github.io/react-native-safe-area-context/docs/'; + 'https://rnsac.appandflow.com/docs/'; export const github = 'https://github.com/AppAndFlow/react-native-safe-area-context'; export const command = 'npm install react-native-safe-area-context';