Skip to content

Commit

Permalink
Attempt to create doc previews
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Aug 28, 2023
1 parent 3cb6522 commit e01f7f6
Show file tree
Hide file tree
Showing 4 changed files with 1,427 additions and 4,802 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/doc-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy doc previews to GitHub Pages
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
concurrency:
group: "preview-${{ github.ref }}"
cancel-in-progress: false
jobs:
deploy-preview:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Restore cache
uses: actions/cache@v3
with:
path: |
docs/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('docs/**/package-lock.json') }}-${{ hashFiles('docs/**.[jt]s', 'docs/**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('docs/**/package-lock.json') }}-
- name: Install dependencies
run: npm install
- name: Build with Next.js
run: npx --no-install next build
env:
NEXTJS_BASE_PATH: "/serverless-iiif/pr-preview/pr-${{ github.event.number }}"
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./docs/out/
21 changes: 5 additions & 16 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
deploy-pages:
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -42,19 +42,8 @@ jobs:
run: npx --no-install next build
env:
NEXTJS_BASE_PATH: "/serverless-iiif"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./docs/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
uses: JamesIves/github-pages-deploy-action@v4
with:
clean-exclude: pr-preview/
folder: ./docs/out
Loading

0 comments on commit e01f7f6

Please sign in to comment.