Skip to content

Commit

Permalink
Update worflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-vasilev committed Apr 30, 2024
1 parent a9224c6 commit 65f9ada
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
15 changes: 1 addition & 14 deletions .github/actions/publish_pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,4 @@ runs:
--target ${{ inputs.target }} \
--output-path ./docs/${{ inputs.base_path }} \
--transform-for-static-hosting \
--hosting-base-path flare/${{ inputs.base_path }};
- name: Commit and push generated documentation
uses: actions/checkout@v3
shell: bash
run: |
cp -r ./docs/${{ inputs.base_path }} ./${{ inputs.base_path }}
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 add ./${{ inputs.base_path }}
git commit -a -m "Generated ${{ inputs.target }} Swift DocC"
git push origin gh-pages
--hosting-base-path flare/${{ inputs.base_path }};
36 changes: 26 additions & 10 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ on:
- main
- dev

permissions:
contents: write
# pages: write
# id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: macos-12
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -33,8 +28,29 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: ${{ matrix.target }} DocC
uses: ./.github/actions/publish_pages
with:
target: ${{ matrix.target }}
base_path: ${{ matrix.base_path }}
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: |
rm -r ./${{ matrix.base_path }}
cp -r ./docs/${{ matrix.base_path }} ./${{ matrix.base_path }}
rm -r ./docs
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 add ./${{ matrix.base_path }}
git commit -a -m "Generated ${{ matrix.target }} Swift DocC"
git push origin gh-pages

0 comments on commit 65f9ada

Please sign in to comment.