I understand you're looking to maintain your blog with Cockpit CMS as a data source and automate the deployment process.
Theres plenty of options available to you.
Managed hosting
You can use services that build and host your content and react to WebHooks and Git commit hooks.
This method makes it really easy and quickly deploy your project minimal configuration.
Self-hosted
Assuming you've configured your own server with SSH access and Node.js, and configured with a Web Server.
You can use a Continuous Delivery to deploy your project to your server.
Some useful articles that might help you;
GitHub has a great free course DevOps with GitHub Actions that would give you a good understanding of automating your deployment with GitHub actions and similar Continuous Delivery systems.
Github Actions
Here's a useful configuration for you taken from a Code Challenge I completed a while ago.
name: ci
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
ci:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup node env
uses: actions/setup-node@v2.1.4
with:
node-version: 14
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Build
run: yarn generate
env:
NODE_ENV: production
BASE_URL: /<MY_REPOSITORY_NAME>
DEV_TO_API_KEY: ${{ secrets.DEV_TO_API_KEY }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
With Github Pages, you may need to configure the BASE_URL
in your nuxt.config.js
export default {
router: {
base: process.env.BASE_URL || '/'
}
}
I really hope these resources helped you with your project.