Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy Docs to Prod #5

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
})