Last active
January 22, 2022 23:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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