Skip to content

Instantly share code, notes, and snippets.

@ArielMejiaDev
Forked from imlautaro/build-and-deploy.yml
Created October 10, 2023 22:02
Show Gist options
  • Save ArielMejiaDev/76eb6758a35dc210a4dc66f734635c13 to your computer and use it in GitHub Desktop.
Save ArielMejiaDev/76eb6758a35dc210a4dc66f734635c13 to your computer and use it in GitHub Desktop.
Workflow to deploy a Nuxt 3 app to GitHub Pages with NPM
name: Build and Deploy
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install & Generate 🔧
run: |
npm ci
npm run generate
env:
NUXT_APP_BASE_URL: ${{ vars.NUXT_APP_BASE_URL }}
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment