Skip to content

Commit

Permalink
Merge pull request #1 from mapcomponents/feature/github-actions
Browse files Browse the repository at this point in the history
Feature/GitHub actions
  • Loading branch information
missserious authored Sep 9, 2024
2 parents 6625339 + f09dc31 commit 8fdc857
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 122 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
name: Deploy to GitHub Pages

on:
push:
branches:
- main
# paths:
# - 'test/**'
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./test
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
245 changes: 123 additions & 122 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,136 +6,137 @@

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "MapComponents Developer Handbook",
tagline: "",
favicon: "img/logo.svg",
staticDirectories: ["static"],
title: "MapComponents Developer Handbook",
tagline: "",
favicon: "img/logo.svg",
staticDirectories: ["static"],

// Set the production url of your site here
url: "https://your-docusaurus-test-site.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
// Set the production url of your site here
url: "https://github.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/developer-manual/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "facebook", // Usually your GitHub org/user name.
projectName: "docusaurus", // Usually your repo name.
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "whereGroup", // Usually your GitHub org/user name.
projectName: "developer-manual", // Usually your repo name.

onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
onBrokenLinks: "ignore",
onBrokenMarkdownLinks: "warn",
deploymentBranch: "gh-pages",

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},

presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),

// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
// blog: {
//
// showReadingTime: true,
// // Please change this to your repo.
// // Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// },
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
// blog: {
//
// showReadingTime: true,
// // Please change this to your repo.
// // Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// },
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: "img/docusaurus-social-card.jpg",
navbar: {
title: "MapComponents",
logo: {
alt: "MapComponents Logo",
src: "img/logo.svg",
},
items: [
{
position: "right",
label: "mapcomponents.org",
href: "https://mapcomponents.org",
},
//{to: '/blog', label: 'Blog', position: 'left'},
{
href: "https://github.com/mapcomponents/react-map-components-maplibre",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Quick Start Guide",
to: "/docs/Getting_Started/Quick_Start_Guide",
},
],
},
{
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/mapcomponents",
},
],
},
{
title: "More",
items: [
//{
// label: 'Blog',
// to: '/blog',
//},
{
label: "GitHub",
href: "https://github.com/mapcomponents",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} MapComponents. Built with Docusaurus.`,
},
//prism: {
// theme: lightCodeTheme,
// darkTheme: darkCodeTheme,
//},
}),
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: "img/docusaurus-social-card.jpg",
navbar: {
title: "MapComponents",
logo: {
alt: "MapComponents Logo",
src: "img/logo.svg",
},
items: [
{
position: "right",
label: "mapcomponents.org",
href: "https://mapcomponents.org",
},
//{to: '/blog', label: 'Blog', position: 'left'},
{
href: "https://github.com/mapcomponents/react-map-components-maplibre",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Quick Start Guide",
to: "/docs/Getting_Started/Quick_Start_Guide",
},
],
},
{
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/mapcomponents",
},
],
},
{
title: "More",
items: [
//{
// label: 'Blog',
// to: '/blog',
//},
{
label: "GitHub",
href: "https://github.com/mapcomponents",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} MapComponents. Built with Docusaurus.`,
},
//prism: {
// theme: lightCodeTheme,
// darkTheme: darkCodeTheme,
//},
}),
};

module.exports = config;

0 comments on commit 8fdc857

Please sign in to comment.