Skip to content

Commit 2c2da52

Browse files
TuvalSimhaardatanDimitri POSTOLOV
authored
New Website: Sofa (#1162)
* New Website: Sofa Fix fix Fix index fix project name * Bring animation back to the new website (#1165) * Fix * Fix * Fix * Update website/package.json Co-authored-by: Dimitri POSTOLOV <[email protected]> * Update website/package.json Co-authored-by: Dimitri POSTOLOV <[email protected]> * Update website/scripts/algolia-ci.mjs Co-authored-by: Dimitri POSTOLOV <[email protected]> * Dima is the best * fix * FIX * Fix animation * add redirects * fix? * fix? Co-authored-by: Arda TANRIKULU <[email protected]> Co-authored-by: Dimitri POSTOLOV <[email protected]>
1 parent 98dba9e commit 2c2da52

Some content is hidden

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

52 files changed

+5152
-6807
lines changed

.github/workflows/website.yml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
name: Website Deployment
1+
name: website
2+
23
on:
34
push:
45
branches:
56
- master
7+
pull_request:
8+
branches:
9+
- master
610

711
jobs:
8-
deploy-website:
9-
name: Deploy Website
12+
deployment:
1013
runs-on: ubuntu-latest
11-
if: contains(github.event.head_commit.message, '[deploy_website]') || contains(github.ref, 'refs/tags/')
14+
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
1215
steps:
13-
- name: Checkout Master
16+
- name: checkout
1417
uses: actions/checkout@v3
15-
- name: Configure Git Credientials
16-
run: |
17-
git config --global user.email "[email protected]"
18-
git config --global user.name "theguild-bot"
19-
echo "machine github.com login theguild-bot password ${{secrets.GITHUB_TOKEN}}" > ~/.netrc
20-
- name: Add origin remote and refetch master
21-
run: |
22-
git remote rm origin
23-
git remote add origin "https://github.com/${{github.repository}}"
24-
git fetch
25-
git checkout master
26-
git reset --hard
27-
- name: Use Node
28-
uses: actions/setup-node@v3
2918
with:
30-
node-version: '16.x'
31-
- name: Get yarn cache
32-
id: yarn-cache
33-
run: echo "::set-output name=dir::$(yarn cache dir)"
34-
- name: Cache Yarn
35-
uses: actions/cache@v3
19+
fetch-depth: 0
20+
21+
- uses: the-guild-org/shared-config/setup@main
22+
name: setup env
3623
with:
37-
path: ${{ steps.yarn-cache.outputs.dir }}
38-
key: ${{ runner.os }}-16-16-yarn-${{ hashFiles('yarn.lock') }}
39-
restore-keys: |
40-
${{ runner.os }}-16-16-yarn-
41-
- name: Deploy 🚀
42-
run: cd website && yarn && yarn deploy
24+
nodeVersion: 18 # change if needed
25+
packageManager: yarn # change if needed
26+
27+
- uses: the-guild-org/shared-config/website-cf@main
28+
name: build and deploy website
4329
env:
44-
GIT_USER: theguild-bot
30+
NEXT_BASE_PATH: ${{ github.ref == 'refs/heads/master' && '/graphql/sofa-api' || '' }}
31+
SITE_URL: ${{ github.ref == 'refs/heads/master' && 'https://the-guild.dev/graphql/sofa-api' || '' }}
32+
NEXT_PUBLIC_ALGOLIA_INDEX_NAME: ${{ secrets.NEXT_PUBLIC_ALGOLIA_INDEX_NAME }}
33+
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY }}
34+
NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }}
35+
with:
36+
cloudflareApiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
37+
cloudflareAccountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
38+
githubToken: ${{ secrets.GITHUB_TOKEN }}
39+
projectName: sofa
40+
prId: ${{ github.event.pull_request.number }}
41+
websiteDirectory: ./
42+
buildScript: cd website && yarn && yarn build && yarn next export
43+
artifactDir: website/out

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/
55
npm-debug.log*
66
lerna-debug.log
77
package-lock.json
8+
.next

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
},
4444
"dependencies": {
4545
"@graphql-tools/utils": "8.12.0",
46-
"ansi-colors": "4.1.3",
4746
"@whatwg-node/fetch": "^0.4.3",
4847
"@whatwg-node/server": "^0.4.1",
48+
"ansi-colors": "4.1.3",
4949
"itty-router": "^2.6.1",
5050
"openapi-types": "12.0.2",
5151
"param-case": "3.0.4",
@@ -68,10 +68,10 @@
6868
"@babel/plugin-proposal-class-properties": "7.18.6",
6969
"@babel/preset-env": "7.19.1",
7070
"@babel/preset-typescript": "7.18.6",
71-
"babel-jest": "29.0.3",
7271
"@types/jest": "29.0.3",
7372
"@types/swagger-ui-dist": "3.30.1",
7473
"@types/yamljs": "0.2.31",
74+
"babel-jest": "29.0.3",
7575
"bob-the-bundler": "1.7.3",
7676
"bundlesize": "0.18.1",
7777
"chalk": "4.1.2",

website/.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
node_modules/
2-
build/
3-
static/animation
1+
public/_redirects
2+
public/animation

website/core/Footer.js

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

website/i18n/en.json

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

website/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

website/next-sitemap.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
3+
module.exports = {
4+
siteUrl: process.env.SITE_URL || 'https://the-guild.dev/graphql/sofa-api',
5+
generateIndexSitemap: false,
6+
};

website/next.config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { withGuildDocs } from '@theguild/components/next.config';
2+
3+
export default withGuildDocs({
4+
images: {
5+
unoptimized: true, // doesn't work with `next export`
6+
allowFutureImage: true,
7+
},
8+
redirects: () =>
9+
Object.entries({}).map(([from, to]) => ({
10+
source: from,
11+
destination: to,
12+
permanent: true,
13+
})),
14+
});

website/package.json

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
{
2+
"name": "website",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"private": true,
26
"scripts": {
3-
"prestart": "yarn build:animation",
4-
"start": "docusaurus-start",
5-
"prebuild": "yarn build:animation",
6-
"build": "docusaurus-build",
7-
"version": "docusaurus-version",
8-
"rename-version": "docusaurus-rename-version",
9-
"build:animation": "rm -rf static/animation && cd animation && yarn && npm run build && cp -r ./build ../static/animation",
10-
"predeploy": "yarn build:animation",
11-
"deploy": "docusaurus-publish"
7+
"algolia-sync": "node scripts/algolia-ci.mjs",
8+
"build:animation": "rm -rf public/animation && cd animation && yarn && npm run build && cp -r ./build ../public/animation",
9+
"prebuild": "npm run build:animation",
10+
"build": "next build && next-sitemap --config next-sitemap.config.cjs",
11+
"predev": "npm run build:animation",
12+
"dev": "next",
13+
"start": "next start",
14+
"postinstall": "patch-package"
15+
},
16+
"dependencies": {
17+
"@theguild/components": "4.0.3",
18+
"next": "12.3.1",
19+
"next-sitemap": "3.1.22",
20+
"patch-package": "6.4.7",
21+
"postinstall-postinstall": "2.1.0",
22+
"react": "18.2.0",
23+
"react-dom": "18.2.0",
24+
"wrangler": "2.1.4"
1225
},
1326
"devDependencies": {
14-
"docusaurus": "1.14.7"
27+
"@guild-docs/algolia": "0.2.2",
28+
"@theguild/algolia": "0.0.2",
29+
"@theguild/tailwind-config": "0.1.0",
30+
"@types/node": "18.7.18",
31+
"@types/react": "18.0.20",
32+
"cross-env": "7.0.3",
33+
"eslint-config-next": "12.3.0",
34+
"postcss-import": "15.0.0",
35+
"tailwindcss": "3.1.8",
36+
"typescript": "4.8.3"
1537
}
1638
}

0 commit comments

Comments
 (0)