Last active
October 10, 2023 22:02
-
-
Save imlautaro/9bd9fab7b180ccd6844a9001cd46e111 to your computer and use it in GitHub Desktop.
Workflow to deploy a Nuxt 3 app to GitHub Pages with NPM
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
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