Skip to content

Commit eaa196d

Browse files
authored
Vercel docs deploy (#153)
* Update docusaurus.config.js * Update docusaurus.config.js * Remove surge * homepage image urls * Update docusaurus.config.js
1 parent 7698991 commit eaa196d

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

.github/workflows/docs-website.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ jobs:
4242
run: yarn build
4343
working-directory: ./website
4444

45-
- name: Deploy docs (staging)
46-
if: github.ref != 'refs/heads/main'
47-
run: yarn deploy:stage
48-
working-directory: ./website
49-
env:
50-
# GH actions have a PR merge commit that _isn't_ our actual commits.
51-
# Manually infer correct branch and sha for pull requests.
52-
FORMIDEPLOY_GIT_SHA: ${{ github.event.pull_request.head.sha }}
53-
GITHUB_DEPLOYMENT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
55-
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
56-
5745
- name: Deploy docs (production)
5846
if: github.ref == 'refs/heads/main'
5947
run: yarn deploy:prod

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config = {
99
title: 'React Native Owl',
1010
tagline: 'Visual Regression Testing for React Native',
1111
url: 'https://formidable.com',
12-
baseUrl: '/open-source/react-native-owl/',
12+
baseUrl: process.env.VERCEL_ENV === "preview" ? '/' : '/open-source/react-native-owl/',
1313
onBrokenLinks: 'throw',
1414
onBrokenMarkdownLinks: 'warn',
1515
favicon: 'images/favicon.ico',

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"docusaurus": "docusaurus",
77
"start": "docusaurus start",
88
"build": "docusaurus build --out-dir build/open-source/react-native-owl",
9+
"build:vercel": "docusaurus build",
910
"swizzle": "docusaurus swizzle",
1011
"clear": "docusaurus clear",
1112
"serve": "formideploy serve",
12-
"deploy:stage": "formideploy deploy --staging",
1313
"deploy:prod": "formideploy deploy --production",
1414
"write-translations": "docusaurus write-translations",
1515
"write-heading-ids": "docusaurus write-heading-ids"

website/src/components/HomepageFeatures/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22

33
import styles from './styles.module.css';
4+
import {useBaseUrlUtils} from "@docusaurus/useBaseUrl";
45

56
const FeatureList = [
67
{
@@ -33,6 +34,7 @@ const FeatureList = [
3334
];
3435

3536
export const HomepageFeatures: React.FC = () => {
37+
const { withBaseUrl } = useBaseUrlUtils()
3638
return (
3739
<>
3840
{FeatureList.map(({ title, description, imageSource }, idx) => {
@@ -44,7 +46,7 @@ export const HomepageFeatures: React.FC = () => {
4446
<div>
4547
{!!imageSource && (
4648
<img
47-
src={`/open-source/react-native-owl${imageSource}`}
49+
src={withBaseUrl(imageSource)}
4850
className={styles.sectionImageMockup}
4951
/>
5052
)}

0 commit comments

Comments
 (0)