-
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.
add an alternative workflow to support copying of resources to docs/
- Loading branch information
Showing
1 changed file
with
80 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,80 @@ | ||
name: Deploy static content from /docs to GitHub Pages, without checkout of the repository | ||
|
||
on: # yamllint disable-line rule:truthy | ||
workflow_call: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
#permissions: | ||
# contents: read | ||
# pages: write | ||
# id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate Pages content | ||
run: | | ||
cd ${{ github.workspace }} | ||
mkdir -p build | ||
cp -r docs build/ | ||
# at his point, "build/docs" contains folders | ||
# index.md, examples (from docs) | ||
# _layouts, assets (also from docs, should be from a template dir) | ||
- name: Checkout blueprints | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: riege/github-pages-build | ||
sparse-checkout: pages-layout | ||
path: _github-pages-build | ||
|
||
- name: Apply blueprints | ||
run: | | ||
# Example when this is invoked from a repo playground-mskopp2: | ||
# github.workspace = /home/runner/work/playground-mskopp2/playground-mskopp2 | ||
# it contains the checked out repository playground-mskopp2 | ||
# plus the contant of riege/github-pages-build | ||
# limited to root folder files plus sub directlry pages-layout | ||
# witin the folder named _github-pages-build | ||
# So ${{ github.workspace }}/_github-pages-build/pages-layout | ||
# contains the _layouts and assets folder. | ||
# | ||
cd ${{ github.workspace }} | ||
mkdir -p build/docs | ||
cp -r _github-pages-build/pages-layout/* build/docs | ||
cp -r docs/* build/docs | ||
### mkdir -p build/docs/schemas | ||
### cp -r src/main/resources/schemas/* build/docs/schemas/ | ||
# at his point, "build/docs" contains folders | ||
# index.md, examples (from docs) | ||
# _layouts, assets (also from docs, should be from a template dir) | ||
### schemas (content = src/main/resources/schemas/*) | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Build HTML from pages .md and .html | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: build/docs | ||
destination: build/pages | ||
|
||
- name: Upload Pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: build/pages | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |