Skip to content

Commit

Permalink
chore: deploy a preview of PRs
Browse files Browse the repository at this point in the history
Deploy PR previews to GitHub pages so changes can be viewed in a more
human-readable way.

NO-TICKET
  • Loading branch information
Judge40 committed Jan 30, 2025
1 parent e1ce243 commit 1e71c7f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy PR Preview to GitHub Pages

permissions:
contents: write
pull-requests: write

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
name: Deploy PR preview to GitHub pages
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Build
if: github.event.action != 'closed'
run: npm install && npm run build

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./dist/
token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ This repository holds the OpenAPI documentation for the TIS Trainee API.

The latest documentation is always available at [health-education-england.github.io/tis-trainee-api](https://health-education-england.github.io/tis-trainee-api/).

Preview of open PRs are available by appending `/pr-preview/pr-{number}` to the end of the
above path e.g. `health-education-england.github.io/tis-trainee-api/pr-preview/pr-123`.

## Developing

### Editing
The [API documentation](openapi.yml) can be worked on within any text editor or
IDE. Plugins are available for several popular IDEs.

### Previewing
Several options are provided for previewing the documentation
Several options are provided for previewing the documentation.

#### Docker
A [Docker compose](docker-compose.yml) file is provided for ease of use, the
Expand Down

0 comments on commit 1e71c7f

Please sign in to comment.