From 4e92b3e07c046fc01ff314ba6961ea602e25c701 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Tue, 30 Apr 2024 17:19:38 +0400 Subject: [PATCH] Update worflows --- .github/actions/publish_pages/action.yml | 15 +----------- .github/workflows/publish-pages.yml | 29 ++++++++++++++++++++---- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/actions/publish_pages/action.yml b/.github/actions/publish_pages/action.yml index fffcbf03b..72b70bd76 100644 --- a/.github/actions/publish_pages/action.yml +++ b/.github/actions/publish_pages/action.yml @@ -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 \ No newline at end of file + --hosting-base-path flare/${{ inputs.base_path }}; \ No newline at end of file diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml index dd97b76d1..c1eba0a2d 100644 --- a/.github/workflows/publish-pages.yml +++ b/.github/workflows/publish-pages.yml @@ -33,8 +33,27 @@ 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 }} \ No newline at end of file + 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: | + cp -r ./docs/${{ matrix.base_path }} ./${{ matrix.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 ./${{ matrix.base_path }} + git commit -a -m "Generated ${{ matrix.target }} Swift DocC" + git push origin gh-pages \ No newline at end of file