chore: add github actions to foomo, for automatic publishes

This commit is contained in:
Stefan Martinov 2021-12-08 14:58:20 +01:00
parent be15317195
commit 124d9c4218
2 changed files with 62 additions and 7 deletions

54
.github/workflows/documentation.yml vendored Normal file
View File

@ -0,0 +1,54 @@
# https://docusaurus.io/docs/deployment#deploying-to-github-pages
name: documentation
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Test Build
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
run: |
git config --global user.email "publisher@foomo.org"
git config --global user.name "gh-actions"
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run deploy

View File

@ -6,16 +6,17 @@
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'foomo project docs',
tagline: 'stuff we wrote, because nobody else wanted to',
url: 'https://foomo.org',
baseUrl: '/',
title: 'Foomo Project Docs',
tagline: 'Stuff we wrote, because nobody else wanted to',
url: "https://foomo.github.io/",
baseUrl: '/foomo-docs/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'bestbytes', // Usually your GitHub org/user name.
projectName: 'foomo', // Usually your repo name.
organizationName: 'foomo', // Usually your GitHub org/user name.
projectName: 'foomo-docs', // Usually your repo name.
deploymentBranch: 'gh-pages',
trailingSlash: false,
presets: [
[