Skip to content

Commit

Permalink
Update worflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-vasilev committed May 1, 2024
1 parent a90e218 commit 622f587
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 26 deletions.
25 changes: 24 additions & 1 deletion .github/actions/publish_pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ inputs:
base_path:
required: true
type: string
# base_path_prefix:
# required: false
# type: string

runs:
using: "composite"
Expand All @@ -16,11 +19,31 @@ runs:
shell: bash
run: |
mkdir ./docs;
swift build;
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target ${{ inputs.target }} \
--output-path ./docs/${{ inputs.base_path }} \
--transform-for-static-hosting \
--hosting-base-path flare/${{ inputs.base_path }};
--hosting-base-path flare/${{ inputs.base_path }};
- name: Commit and push generated documentation
run: |
git fetch
git worktree add --checkout gh-pages origin/gh-pages
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git switch gh-pages
rm -r ./${{ inputs.base_path }}
cp -r ./docs/${{ inputs.base_path }} ./${{ inputs.base_path }}
rm -r ./docs
git add ./${{ inputs.base_path }}
git commit -a -m "Generated ${{ inputs.target }} Swift DocC"
git push origin gh-pages
git worktree remove gh-pages
58 changes: 33 additions & 25 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,39 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build DocC
shell: bash
run: |
mkdir ./docs;
swift build;
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target ${{ matrix.target }} \
--output-path ./docs/${{ matrix.base_path }} \
--transform-for-static-hosting \
--hosting-base-path flare/${{ matrix.base_path }};
- name: Commit and push generated documentation
run: |
git fetch
git worktree add --checkout gh-pages origin/gh-pages
- name: Build and Push Generated Documentation
uses: ./.github/actions/publish_pages
with:
target: ${{ matrix.target }}
base_path: ${{ matrix.base_path }}

# - name: Build DocC
# shell: bash
# run: |
# mkdir ./docs;
# swift build;
# swift package \
# --allow-writing-to-directory ./docs \
# generate-documentation \
# --target ${{ matrix.target }} \
# --output-path ./docs/${{ matrix.base_path }} \
# --transform-for-static-hosting \
# --hosting-base-path flare/${{ matrix.base_path }};
# - name: Commit and push generated documentation
# run: |
# git fetch
# git worktree add --checkout gh-pages origin/gh-pages

# git config --local user.email "github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git switch gh-pages

git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git switch gh-pages
# rm -r ./${{ matrix.base_path }}
# cp -r ./docs/${{ matrix.base_path }} ./${{ matrix.base_path }}
# rm -r ./docs

rm -r ./${{ matrix.base_path }}
cp -r ./docs/${{ matrix.base_path }} ./${{ matrix.base_path }}
rm -r ./docs
# git add ./${{ matrix.base_path }}
# git commit -a -m "Generated ${{ matrix.target }} Swift DocC"
# git push origin gh-pages

git add ./${{ matrix.base_path }}
git commit -a -m "Generated ${{ matrix.target }} Swift DocC"
git push origin gh-pages
# git worktree remove gh-pages

0 comments on commit 622f587

Please sign in to comment.