Fix YesSql Concurrency Issue (#459) #126
This file contains hidden or 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
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_deploy: ${{ steps.evaluate.outputs.should_deploy }} | |
| doc_version: ${{ steps.evaluate.outputs.doc_version }} | |
| skip_reason: ${{ steps.evaluate.outputs.skip_reason }} | |
| steps: | |
| - name: Evaluate deployment target | |
| id: evaluate | |
| shell: bash | |
| run: | | |
| should_deploy=false | |
| doc_version= | |
| skip_reason= | |
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" || "${GITHUB_REF}" == "refs/heads/main" ]]; then | |
| should_deploy=true | |
| elif [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| if [[ "${GITHUB_REF_NAME}" == *-* ]]; then | |
| skip_reason="Skipping documentation deployment for prerelease tag ${GITHUB_REF_NAME}." | |
| elif [[ "${GITHUB_REF_NAME}" =~ ^v([0-9]+)\.([0-9]+)\.0$ ]]; then | |
| should_deploy=true | |
| doc_version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x" | |
| else | |
| skip_reason="Skipping documentation deployment for patch tag ${GITHUB_REF_NAME}." | |
| fi | |
| else | |
| skip_reason="Skipping documentation deployment for ref ${GITHUB_REF}." | |
| fi | |
| { | |
| echo "should_deploy=${should_deploy}" | |
| echo "doc_version=${doc_version}" | |
| echo "skip_reason=${skip_reason}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Report skipped deployment | |
| if: steps.evaluate.outputs.should_deploy != 'true' | |
| run: echo "${{ steps.evaluate.outputs.skip_reason }}" | |
| build: | |
| needs: prepare | |
| if: needs.prepare.outputs.should_deploy == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/CrestApps.Docs | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: src/CrestApps.Docs/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Create versioned docs on qualifying tag push | |
| if: needs.prepare.outputs.doc_version != '' | |
| run: | | |
| echo "Creating docs version ${{ needs.prepare.outputs.doc_version }}" | |
| npx docusaurus docs:version "${{ needs.prepare.outputs.doc_version }}" | |
| - name: Build site | |
| run: npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: src/CrestApps.Docs/build | |
| deploy: | |
| if: needs.prepare.outputs.should_deploy == 'true' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: [prepare, build] | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |