Skip to content

Commit

Permalink
ci: deploy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Aug 10, 2024
1 parent 6fcc683 commit 586d2a1
Show file tree
Hide file tree
Showing 11 changed files with 7,033 additions and 162 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy

on:
push:
branches:
- 'main'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Tools
uses: ./.github/actions/install-tools

- name: Install Dependencies
uses: ./.github/actions/install-dependencies

- name: Deploy to Netlify
run: pnpm run docs:deploy --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
shell: bash
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pnpm-debug.log*

# Build
lib-types/
.netlify/
server/
dist/
lib/
Expand All @@ -18,4 +19,4 @@ tmp/
coverage/

# Misc
.DS_Store
.DS_Store
19 changes: 19 additions & 0 deletions docs/adapters/netlify-edge/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { netlifyEdgeAdapter } from '@builder.io/qwik-city/adapters/netlify-edge/vite'
import { extendConfig } from '@builder.io/qwik-city/vite'
import path from 'node:path'

import baseConfig from '../../../vite.config.docs'

export default extendConfig(baseConfig, () => ({
build: {
rollupOptions: {
input: [
path.join(__dirname, '../../entry.netlify-edge.tsx'),
'@qwik-city-plan',
],
},
outDir: path.join(__dirname, '../../server/.netlify/edge-functions/entry'),
ssr: true,
},
plugins: [netlifyEdgeAdapter()],
}))
17 changes: 17 additions & 0 deletions docs/entry.netlify-edge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { PlatformNetlify } from '@builder.io/qwik-city/middleware/netlify-edge'

import { createQwikCity } from '@builder.io/qwik-city/middleware/netlify-edge'
import { manifest } from '@qwik-client-manifest'
import qwikCityPlan from '@qwik-city-plan'

import render from './entry.ssr'

declare global {
type QwikCityPlatform = PlatformNetlify
}

export default createQwikCity({
qwikCityPlan,
manifest,
render,
})
5 changes: 5 additions & 0 deletions docs/mocks/vscode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export let workspace = {
getConfiguration: () => ({
get: () => {},
}),
}
2 changes: 2 additions & 0 deletions docs/public/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/*
Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
publish = "docs/dist"
command = "pnpm run docs:build"

[functions]
directory = "docs/server/.netlify/edge-functions"
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"docs:clean": "pnpm run /^docs:clean:/",
"docs:debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
"docs:preview": "pnpm run docs:clean && qwik build preview && vite preview --open --config vite.config.docs.ts",
"docs:deploy": "netlify deploy --build",
"build.client": "vite build --config vite.config.docs.ts",
"build.server": "vite build --config ./docs/adapters/netlify-edge/vite.config.ts",
"build.types": "tsc --incremental --noEmit",
"build.preview": "vite build --ssr docs/entry.preview.tsx --config vite.config.docs.ts",
"scripts:preview": "tsx ./scripts/generate-preview.ts",
Expand Down Expand Up @@ -165,6 +167,7 @@
"@builder.io/qwik-city": "^1.8.0",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@netlify/edge-functions": "^2.10.0",
"@types/culori": "^2.1.1",
"@types/eslint": "^9.6.0",
"@types/node": "^22.2.0",
Expand All @@ -187,6 +190,7 @@
"eslint-plugin-vitest": "^0.5.4",
"focus-trap": "^7.5.4",
"lightningcss": "^1.26.0",
"netlify-cli": "^17.34.0",
"prettier": "^3.3.3",
"puppeteer": "^23.0.2",
"shiki": "^1.12.1",
Expand All @@ -202,7 +206,6 @@
"typescript": "^5.5.4",
"undici": "^6.19.7",
"vite": "^5.4.0",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.0.5"
}
}
Loading

0 comments on commit 586d2a1

Please sign in to comment.