Skip to content

Instantly share code, notes, and snippets.

@kevcodez
Last active January 12, 2021 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevcodez/a60a96d1ddbc3b51d43a6cd46d57526d to your computer and use it in GitHub Desktop.
Save kevcodez/a60a96d1ddbc3b51d43a6cd46d57526d to your computer and use it in GitHub Desktop.
Github Pages + Nuxt Content Deploy
name: docs
# define the trigger
on: [push, pull_request]
jobs:
docs:
runs-on: ${{ matrix.os }}
env:
# We used "docs" as directory name for our documentation, we will be referencing this later
working-directory: docs
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
# Check out master branch
- name: Checkout
uses: actions/checkout@master
# Downloads, configures and caches Node.js
- name: Setup node env
uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node }}
# Install all dependencies needed to build our documentation
- name: Install dependencies
# Referencing our docs directory here
working-directory: ${{env.working-directory}}
run: yarn
# The generate command is used to invoke Nuxt static site generation
- name: Generate
working-directory: ${{env.working-directory}}
run: yarn run generate
# Pushes the files to a branch called "gh-pages" that will be used as deployment branch
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
# This token is automatically invoked
github_token: ${{ secrets.GITHUB_TOKEN }}
# Nuxt export the statically generated files in the dist directory by default
publish_dir: ./${{env.working-directory}}/dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment