Skip to content

Commit

Permalink
Deploy Docs to Prod
Browse files Browse the repository at this point in the history
Adds:
- Deploy to prod github action (not tested yet)
- Base path to properly route to apollo.volvox.tech/docs in prod
  • Loading branch information
mhallmark committed Oct 22, 2023
1 parent 4f29453 commit b37fa2c
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 13 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/deploy-docs-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Image and Deploy API to Production

on:
push:
tags:
- "*"
workflow_dispatch:

env:
IMAGE_NAME: volvoxllc/volvox.apollo/docs
REGISTRY: ghcr.io

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Deploy to Droplet
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.VOLVOX_APOLLO_SSH_KEY }}
script: |
cd /opt/volvox
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker compose up -d
25 changes: 14 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx"
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx"
})

module.exports = withNextra({
// basePath: "/docs",
content: [
"./pages/**/*.{js,jsx,ts,tsx,md,mdx}",
"./components/**/*.{js,jsx,ts,tsx,md,mdx}"
],
eslint: {
// Warning: This allows production builds to successfully complete even if your project has ESLint errors.
ignoreDuringBuilds: true
}
// basePath: "/docs",
content: [
"./pages/**/*.{js,jsx,ts,tsx,md,mdx}",
"./components/**/*.{js,jsx,ts,tsx,md,mdx}"
],
eslint: {
// Warning: This allows production builds to successfully complete even if your project has ESLint errors.
ignoreDuringBuilds: true
},

// Required to properly route to apollo.volvox.tech/docs.
basePath: '/docs'
})
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b37fa2c

Please sign in to comment.