Create nextjs.yml #78
This file contains 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
# https://dev.to/vanwildemeerschbrent/how-to-deploy-to-github-pages-using-github-actions-57k8 | |
# Name that will define how it shows up in | |
# your Github Action overview for this repository | |
name: Build and Deploy | |
# Defines what events the workflow will listen to in repository | |
# In this case commits and pull-requests on master-branch | |
on: | |
push: | |
branches: [main] | |
# What jobs will run in your workflow -> build_and_deploy | |
# Jobs can run in parallel or sequentially | |
jobs: | |
build_and_deploy: | |
# Type of runner that this job wil run on -> Linux Ubuntu | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# Steps that are part of the build_and_deploy job | |
# Steps represent a sequence of tasks that will be executed | |
steps: | |
# Action that will checkout repository so the workflow can | |
# access the codebase | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
# Sets node environment for use in action | |
# {{matrix.node-version}} will use Github default Node.js | |
# version | |
- name: Node ${{matrix.node-version}} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{matrix.node-version}} | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build Project | |
run: pnpm build | |
# please check out the docs of the workflow for more details | |
# @see https://github.com/crazy-max/ghaction-github-pages | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v3 | |
with: | |
# deploy to gh-pages branch | |
target_branch: release | |
# deploy the default output dir of VuePress | |
build_dir: out | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |