Skip to content
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

Use a github action to build the website #75

Open
wants to merge 3 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
29 changes: 29 additions & 0 deletions .github/workflows/build-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build the `website/public` directory on PRs to verify it doesn't error.

name: Verify the website/src directory builds

# Run whenever the `website/public` folder in the `main` branch changes.
on:
pull_request:
branches:
- "main"
paths:
- "website/**"
# Allow manual runs from the Actions tab
workflow_dispatch:

jobs:
build-gh-pages:
runs-on: ubuntu-latest
steps:
# Check out the repository
- uses: actions/checkout@v3
# Install dependancies
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install
run: cd website && npm install
# Build the website
- name: Build
run: cd website && npm run build
36 changes: 25 additions & 11 deletions .github/workflows/push-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Push the `website/public` directory to the `gh-pages` branch.
# Builds & pushes 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 contains the compiled html from running @11ty/eleventy
# on 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.
# an exact mirror of running 'npm run build' and generating a `website/public`
# directory on the `main` branch. This workflow performs that build & mirror,
# which then triggers the `gh-pages` branch to 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'
- "main"
paths:
- 'website/public/**'
- "website/**"
# Allow manual runs from the Actions tab
workflow_dispatch:

Expand All @@ -26,6 +26,20 @@ jobs:
steps:
# Check out the repository
- uses: actions/checkout@v3
# 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
# Install dependancies
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install
run: cd website && npm install
# Build the website
- name: Build
run: cd website && npm run build
# Push the `website/public` directory to `gh-pages`
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: website/public
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: ${{ github.event.head_commit.message }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
website/public
Empty file removed website/public/.nojekyll
Empty file.
1 change: 0 additions & 1 deletion website/public/CNAME

This file was deleted.

221 changes: 0 additions & 221 deletions website/public/about/index.html

This file was deleted.

Loading