Skip to content

Commit

Permalink
add gh pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Nov 22, 2024
1 parent 98149be commit 70b09bd
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/nuxt-to-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: build and deploy nuxt app

on:
push:
branches: ["master"]

# allow running this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Cache Node Modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm install

- name: Static HTML export with Nuxt
run: npx nuxi generate

- name: Create .nojekyll
run: touch ./dist/.nojekyll

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 70b09bd

Please sign in to comment.