Skip to content

Commit

Permalink
add deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
JollyGrin committed Dec 10, 2024
1 parent 4776335 commit fda6f4b
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Deploy Next.js site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: pnpm

- name: Install Dependencies
run: |
cd dcl-attend-frontend
pnpm install --frozen-lockfile
- name: Setup Pages
uses: actions/configure-pages@v3
with:
static_site_generator: next

- name: Restore Next.js cache
uses: actions/cache@v3
with:
path: dcl-attend-frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('dcl-attend-frontend/**/pnpm-lock.yaml') }}-${{ hashFiles('dcl-attend-frontend/**.[jt]s', 'dcl-attend-frontend/**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('dcl-attend-frontend/**/pnpm-lock.yaml') }}-
- name: Build with Next.js
run: |
cd dcl-attend-frontend
pnpm next build
# - name: Run postbuild script
# run: |
# cd frontend
# pnpm node lib/buildTools/prefixFonts.js

# - name: Export Static HTML with Next.js
# run: |
# cd frontend
# pnpm next export

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dcl-attend-frontend/out

# Deployment job
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@v2

0 comments on commit fda6f4b

Please sign in to comment.