Skip to content

Change workflow for PR preview #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/scripts/README.md

This file was deleted.

59 changes: 0 additions & 59 deletions .github/scripts/cleanup-preview.js

This file was deleted.

47 changes: 0 additions & 47 deletions .github/scripts/comment-preview.js

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/cleanup-preview.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/deploy-preview.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy PR previews # Name of your workflow

on:
pull_request:
types: [opened, reopened, synchronize, closed] # Trigger on PR open, reopen, sync, or close

permissions:
contents: write
pages: write
id-token: write
pull-requests: write
deployments: write

jobs:
deploy-preview:
runs-on: ubuntu-latest # Use a suitable runner environment

steps:
- uses: actions/checkout@v4 # Checkout the code from the pull request

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Antora
run: npm install antora

- name: Generate Site
run: npx antora antora-playbook.yml

- name: Disable Jekyll
run: touch build/site/.nojekyll

- name: Deploy preview # Deploy the built site as a preview
uses: rossjrw/pr-preview-action@v1 # Use the pr-preview-action
with:
source-dir: ./build/site # Directory containing the built site files
preview-branch: test # The branch to deploy previews to (usually gh-pages for GitHub Pages)
umbrella-dir: pr-preview # Directory within the preview branch to store previews
action: auto # Automatically handles deployment and cleanup (deploy/remove)

- name: Remove preview on closed PR # Remove the preview when the PR is closed
if: github.event.action == 'closed' # Condition to run only on PR close
uses: rossjrw/pr-preview-action@v1 # Use the pr-preview-action again
with:
action: remove # Specify the action to remove the preview
umbrella-dir: pr-preview # Directory where previews are stored
64 changes: 0 additions & 64 deletions .github/workflows/publish.yml

This file was deleted.