Skip to content

Commit

Permalink
wip ci cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Radu Dumitrescu committed Feb 9, 2024
1 parent c13b33f commit 594777b
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 78 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/dev-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["migrate-to-docusaurus"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
deploy:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.120.4
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: Genez-io/genezio-github-action@main
with:
token: ${{ secrets.GENEZIO_TOKEN }}
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Docs Node.js dependencies
run: npm ci
- name: Build Docs
run: npm run build
- name: Clone Repo https://github.com/Genez-io/genezio-landing-page/
run: git clone https://github.com/Genez-io/genezio-landing-page/
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
cd genezio-landing-page
git checkout dev
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Copy public folder
run: cp -r genezio-landing-page/public/ public/
- name: Copy build files to /public/docs
run: |
mkdir -p public/docs/
cp -r build/* public/docs/
- name: Deploy deploy
working-directory: ./
run: genezio deploy --frontend --stage dev
141 changes: 70 additions & 71 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const config = {
url: "https://genezio.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
baseUrl: "/docs/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand All @@ -31,93 +31,92 @@ const config = {
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
locales: ["en"]
},

plugins: ["plugin-image-zoom"],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
{
docs: {
sidebarPath: "./sidebars.js",
routeBasePath: "/",
// Please change this to your repo.
// Remove this to remove the "edit this page" links.,
include: ["**/*.md", "**/.*.md"], // Include dot files
include: ["**/*.md", "**/.*.md"] // Include dot files
},
blog: false,
theme: {
customCss: "./src/css/custom.css",
},
}),
],
customCss: "./src/css/custom.css"
}
}
]
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: "img/genezio.svg",
navbar: {
title: "Genezio Documentation",
logo: {
alt: "Genezio Logo",
src: "img/favicon.ico",
srcDark: "img/genezio.svg",
},
},
// footer: {
// style: "dark",
// links: [
// {
// title: "Docs",
// items: [
// {
// label: "Tutorial",
// to: "/docs/intro",
// },
// ],
// },
// {
// title: "Community",
// items: [
// {
// label: "Stack Overflow",
// href: "https://stackoverflow.com/questions/tagged/docusaurus",
// },
// {
// label: "Discord",
// href: "https://discordapp.com/invite/docusaurus",
// },
// {
// label: "Twitter",
// href: "https://twitter.com/docusaurus",
// },
// ],
// },
// {
// title: "More",
// items: [
// {
// label: "Blog",
// to: "/blog",
// },
// {
// label: "GitHub",
// href: "https://github.com/facebook/docusaurus",
// },
// ],
// },
// ],
// copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
// },
prism: {
theme: prismThemes.oneLight,
darkTheme: prismThemes.dracula,
},
}),
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
themeConfig: {
// Replace with your project's social card
image: "img/genezio.svg",
navbar: {
title: "Genezio Documentation",
logo: {
alt: "Genezio Logo",
src: "img/favicon.ico",
srcDark: "img/genezio.svg"
}
},
// footer: {
// style: "dark",
// links: [
// {
// title: "Docs",
// items: [
// {
// label: "Tutorial",
// to: "/docs/intro",
// },
// ],
// },
// {
// title: "Community",
// items: [
// {
// label: "Stack Overflow",
// href: "https://stackoverflow.com/questions/tagged/docusaurus",
// },
// {
// label: "Discord",
// href: "https://discordapp.com/invite/docusaurus",
// },
// {
// label: "Twitter",
// href: "https://twitter.com/docusaurus",
// },
// ],
// },
// {
// title: "More",
// items: [
// {
// label: "Blog",
// to: "/blog",
// },
// {
// label: "GitHub",
// href: "https://github.com/facebook/docusaurus",
// },
// ],
// },
// ],
// copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
// },
prism: {
theme: prismThemes.oneLight,
darkTheme: prismThemes.dracula
}
}
};

export default config;
10 changes: 3 additions & 7 deletions genezio.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: genezio-docs
name: genezio-landing-page
region: us-east-1
cloudProvider: genezio
# scripts:
# preFrontendDeploy: npm install && npm run build
frontend:
path: ./build
subdomain: genezio-docs
packageManager: npm
path: ./public
subdomain: genezio-landing-page

0 comments on commit 594777b

Please sign in to comment.