Skip to content

Commit

Permalink
Try another way to support copying of resources to docs/
Browse files Browse the repository at this point in the history
  • Loading branch information
mskopp committed Apr 17, 2024
1 parent 1ea41b8 commit 74e4cbe
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 83 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/pages-generate-from-docs-dir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ name: Deploy static content from /docs to GitHub Pages

on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
from1:
required: false
type: string
description: "Optional subdirectory to copy into docs, it will do cp -r inputs.from1/* build/docs/inputs.to1"
to1:
required: false
type: string
description: "Optional but required if from1 is provided: Target directly under 'docs/' to copy into"
from2:
required: false
type: string
description: "Optional 2nd subdirectory into docs, it will do cp -r inputs.from2/* build/docs/inputs.to2"
to2:
required: false
type: string
description: "Optional but required if from2 is provided: Target directly under 'docs/' to copy into"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
#permissions:
Expand Down Expand Up @@ -55,7 +72,7 @@ jobs:
# 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
Expand All @@ -67,9 +84,21 @@ jobs:
# _layouts, assets (also from docs, should be from a template dir)
### schemas (content = src/main/resources/schemas/*)
- name: Copy recursively FROM1 to TO1, e.g. from1=src/main/resources/schemas to1=schemas
if: ${{ inputs.from1 }}
run: |
mkdir -p build/docs/${{ inputs.to1 }}
cp -r ${{ inputs.from1 }}/* build/docs/${{ inputs.to1 }}/
- name: Copy recursively FROM2 to TO2, e.g. from2=src/main/resources/schemas to2=schemas
if: ${{ inputs.from2 }}
run: |
mkdir -p build/docs/${{ inputs.to2 }}
cp -r ${{ inputs.from2 }}/* build/docs/${{ inputs.to2 }}/
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build HTML from pages .md and .html
uses: actions/jekyll-build-pages@v1
with:
Expand Down
80 changes: 0 additions & 80 deletions .github/workflows/pages-generate-with-file-copy.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ jobs:
# Single pages job since we're just building and deploying GitHub pages
pages:
uses: "riege/github-pages-build/.github/workflows/pages-generate-from-docs-dir.yml@main"
with:
from1: img
to1: demo-img
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ This is the index.md file to demonstrate usage of a general
workflows and layouts to build GitHub pages from a Riege Software GitHub
repository.

For more information, see [github.com/riege/github-pages-build](https://github.com/riege/github-pages-build).
For more information, see README in [github.com/riege/github-pages-build](https://github.com/riege/github-pages-build).

Note: The following link to [demo-img/pages-settings.png](demo-img/pages-settings.png) is a test for the from/to copy option.

0 comments on commit 74e4cbe

Please sign in to comment.