Skip to content

Instantly share code, notes, and snippets.

@jlcarvalho
Last active January 22, 2022 23:39
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 jlcarvalho/407edac3428ecc53747304cad93b791b to your computer and use it in GitHub Desktop.
Save jlcarvalho/407edac3428ecc53747304cad93b791b to your computer and use it in GitHub Desktop.
Post: Exemplos de como realizar deploy de uma aplicação Next.js no GH Pages
name: Deploy
on:
push:
branches:
- master
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.18
- name: Install node dependencies
run: yarn install
- name: Run linter
run: yarn lint
- name: Build
run: yarn build
- name: Deploy
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: out
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
const isProd = process.env.NODE_ENV === "production";
const prefix = isProd ? "/guia-frontend" : "";
module.exports = {
basePath: prefix,
assetPrefix: prefix,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment