Skip to content

Commit 0322de1

Browse files
authored
Updated Workflow
1 parent 3b5cd0b commit 0322de1

File tree

1 file changed

+34
-26
lines changed

1 file changed

+34
-26
lines changed

.github/workflows/nuxtjs.yml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
1-
name: Deploy Nuxt to GitHub Pages
2-
1+
# https://github.com/actions/deploy-pages#usage
2+
name: Deploy to GitHub Pages
33
on:
4+
workflow_dispatch:
45
push:
56
branches:
6-
- prod # or your default branch
7-
7+
- main
88
jobs:
9-
build-and-deploy:
9+
build:
1010
runs-on: ubuntu-latest
11-
1211
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v4
12+
- uses: actions/checkout@v4
13+
- run: corepack enable
14+
- uses: actions/setup-node@v4
1815
with:
19-
node-version: 18
20-
21-
- name: Install dependencies
22-
run: npm install
23-
24-
- name: Build Nuxt app
25-
run: npm run build
26-
27-
- name: Export static site
28-
run: npm run generate
29-
30-
- name: Deploy to GitHub Pages
31-
uses: peaceiris/actions-gh-pages@v4
16+
node-version: "20"
17+
# Pick your own package manager and build script
18+
- run: npm install
19+
- run: npx nuxt build --preset github_pages
20+
- name: Upload artifact
21+
uses: actions/upload-pages-artifact@v3
3222
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: .output/public
23+
path: ./.output/public
24+
# Deployment job
25+
deploy:
26+
# Add a dependency to the build job
27+
needs: build
28+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
29+
permissions:
30+
pages: write # to deploy to Pages
31+
id-token: write # to verify the deployment originates from an appropriate source
32+
# Deploy to the github_pages environment
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
# Specify runner + deployment step
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4
42+

0 commit comments

Comments
 (0)