-
Notifications
You must be signed in to change notification settings - Fork 9
31 lines (28 loc) · 1.2 KB
/
push-gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Push the `website/public` directory to the `gh-pages` branch.
#
# The 'main' branch of this repository is the source of truth for the website content.
# The gh-pages branch simply exists as a mirror of `website/public` directory
# of the `main` branch to serve that site content via GitHub pages.
# The `gh-pages` branch should never be edited directly, and should always be
# an exact mirror of the `website/public` directory on the `main` branch.
# This workflow performs that mirror, which then triggers another action
# on the `gh-pages` branch that deploys the site content to GitHub Pages.
name: Push website/public directory to gh-pages branch
# Run whenever the `website/public` folder in the `main` branch changes.
on:
push:
branches:
- 'main'
paths:
- 'website/public/**'
# Allow manual runs from the Actions tab
workflow_dispatch:
jobs:
push-gh-pages:
runs-on: ubuntu-latest
steps:
# Check out the repository
- uses: actions/checkout@v4
# Push the `website/public` directory to `gh-pages` via `git subtree push`
- name: Push to gh-pages branch
run: git push origin `git subtree split --prefix website/public main`:gh-pages --force