-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Wouter Termont <[email protected]>
- Loading branch information
1 parent
569d588
commit 45643be
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
## | ||
# This workflow renders a new version of each changed spec for GitHub Pages. | ||
## | ||
|
||
name: GitHub Pages workflow | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: # for testing | ||
|
||
env: | ||
build_dir: _gh_pages_build | ||
|
||
jobs: | ||
|
||
conditional-build-deploy: | ||
name: Build and deploy changed specs | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
|
||
- name: Detect changed specs | ||
uses: dorny/paths-filter@v3 | ||
with: | ||
base: ${{ github.ref }} | ||
filters: | | ||
level0: level0/** | ||
# level1: level1/** | ||
# level2: level2/** | ||
id: filter | ||
|
||
- name: Set Python version | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '>=3.9' | ||
|
||
- name: Install Bikeshed | ||
run: pipx install --python $(which python) --quiet bikeshed | ||
|
||
- name: Setup build environment | ||
run: | | ||
mkdir -p "${{ env.build_dir }}" | ||
cp common/* level0/ | ||
echo "time=$(date +"%Y%m%d%H%M%S")" >> "$GITHUB_OUTPUT" | ||
# && cp common/* level1/ && cp common/* level2/ | ||
|
||
- name: Build Level 0 | ||
if: steps.filter.outputs.level0 == 'true' | ||
run: bikeshed spec level0/index.bs "${{ env.build_dir }}/level0/index.html" | ||
id: bikeshed | ||
|
||
# - name: Build Level 1 | ||
# if: steps.filter.outputs.level1 == 'true' | ||
# run: bikeshed spec level1/index.bs "${{ env.build_dir }}/level1/index.html" | ||
# id: bikeshed | ||
|
||
# - name: Build Level 2 | ||
# if: steps.filter.outputs.level2 == 'true' | ||
# run: bikeshed spec level2/index.bs "${{ env.build_dir }}/level2/index.html" | ||
# id: bikeshed | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: "${{ env.build_dir }}" | ||
target-folder: "specs" | ||
commit-message: "publish: changes at ${{ steps.bikeshed.outputs.time }}" | ||
branch: gh-pages | ||
tag: "v${{ steps.bikeshed.outputs.time }}" |