Skip to content

Commit 2ed575c

Browse files
authored
feat: create a new docs website (#2525)
## Summary: I had previously created a documentation website in a new repo at r[eact-native-macos-docs](https://github.com/microsoft/react-native-macos-docs), however due to how Github Pages works, I can't easily publish that to microsoft.github.io/react-native-macos. So... let's move it here. ## Test Plan: `yarn start` deploys the website locally, successfully.
1 parent 9fa3448 commit 2ed575c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+13495
-400
lines changed

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Basic `dependabot.yml` file with
2+
# minimum configuration for three package managers
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "npm"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
groups:
11+
docusaurus:
12+
patterns:
13+
- "@docusaurus/*"
14+
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build Website
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
build-path:
7+
description: "Path to the build directory"
8+
value: ${{ jobs.build.outputs.build-path }}
9+
10+
jobs:
11+
build:
12+
name: "Build the website"
13+
runs-on: ubuntu-24.04
14+
outputs:
15+
build-path: ./build
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '22'
23+
- name: Install dependencies
24+
run: yarn
25+
working-directory: ./docsite
26+
- name: Build website
27+
run: yarn build
28+
working-directory: ./docsite
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: website-build
33+
path: ./docsite/build
34+
retention-days: 1

.github/workflows/microsoft-pr.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, edited]
6+
branches: [ "main" ]
7+
8+
concurrency:
9+
# Ensure single build of a pull request. `main` should not be affected.
10+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint-commit:
15+
name: "Lint PR title"
16+
permissions: {}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
filter: blob:none
22+
fetch-depth: 0
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '22'
26+
# We lint the PR title instead of the commit message to avoid script injection attacks.
27+
# Using environment variables prevents potential security vulnerabilities as described in:
28+
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#example-of-a-script-injection-attack
29+
- name: Lint PR title
30+
env:
31+
PR_TITLE: ${{ github.event.pull_request.title }}
32+
run: |
33+
echo "$PR_TITLE" | npx @rnx-kit/[email protected]
34+
build-website:
35+
name: "Build the website"
36+
permissions: {}
37+
uses: ./.github/workflows/microsoft-build-website.yml
38+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run
18+
# in-progress and latest queued. However, do NOT cancel in-progress runs as we
19+
# want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
uses: ./.github/workflows/microsoft-build-website.yml
28+
29+
# Prepare for Pages deployment
30+
prepare-pages:
31+
runs-on: ubuntu-24.04
32+
needs: build
33+
steps:
34+
- name: Download build artifacts
35+
uses: actions/download-artifact@v4
36+
with:
37+
name: website-build
38+
path: ./docsite/build
39+
- name: Upload Pages artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: ./docsite/build
43+
44+
# Deployment job
45+
deploy:
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-24.04
50+
needs: prepare-pages
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

docs/WritingNativeComponents.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)