Skip to content

Commit

Permalink
Setup gh-pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
shakuzen committed Sep 16, 2023
1 parent 5a83200 commit 3666b39
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 22 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build-pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build pull-request

on:
pull_request:
branches:
- main
# 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-pullrequest:
name: Build pull-request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
# 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:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

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

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
18 changes: 7 additions & 11 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ const config = {
favicon: 'img/favicon.ico',

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

// 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.
organizationName: 'JapanFinance', // Usually your GitHub org/user name.
projectName: 'JapanFinance.github.io', // Usually your repo name.

// GitHub Pages adds a trailing slash to Docusaurus URLs by default. It is recommended to set a trailingSlash config (true or false, not undefined).
trailingSlash: true,

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
Expand All @@ -42,14 +45,7 @@ const config = {
// 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/',
'github.com/JapanFinance/JapanFinance.github.io/tree/main/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "docusaurus-classic-typescript",
"name": "japanfinance-wiki",
"version": "0.0.0",
"private": true,
"scripts": {
Expand Down Expand Up @@ -44,5 +44,5 @@
"engines": {
"node": ">=16.14"
},
"description": "Docusaurus example project (classic-typescript template)"
"description": "Website for r/JapanFinance wiki"
}
4 changes: 2 additions & 2 deletions sandbox.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"hardReloadOnChange": true,
"view": "browser",
"template": "docusaurus",
"node": "16",
"node": "18",
"container": {
"node": "16"
"node": "18"
}
}
7 changes: 0 additions & 7 deletions src/pages/markdown-page.md

This file was deleted.

0 comments on commit 3666b39

Please sign in to comment.