Skip to content

Commit

Permalink
swap backout for nextjs publish yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahongsf committed Oct 17, 2024
1 parent a1eb644 commit de86848
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 41 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/deploy.yml

This file was deleted.

46 changes: 23 additions & 23 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# .github/workflows/preview.yml
name: Deploy PR previews
concurrency: preview-${{ github.ref }}
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm i && npm run build
if: github.event.action != 'closed'
- uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./out
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
# # .github/workflows/preview.yml
# name: Deploy PR previews
# concurrency: preview-${{ github.ref }}
# on:
# pull_request:
# types:
# - opened
# - reopened
# - synchronize
# - closed
# jobs:
# deploy-preview:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - run: npm i && npm run build
# if: github.event.action != 'closed'
# - uses: rossjrw/pr-preview-action@v1
# with:
# source-dir: ./out
# preview-branch: gh-pages
# umbrella-dir: pr-preview
# action: auto

52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# File: .github/workflows/publish.yml
name: Publish to Github Pages
on:
push:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/setup-node

- name: Setup Pages ⚙️
uses: actions/configure-pages@v4
with:
static_site_generator: next

- name: Build with Next.js 🏗️
run: npx next build # TODO: return to update to use yarn build or simplify build process

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

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
needs: build

steps:
- name: Publish to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit de86848

Please sign in to comment.