diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86e67ff2ff8..e105459a1dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: pull_request: - types: [opened, synchronize, reopened, ready_for_review, closed] + types: [opened, synchronize, reopened, ready_for_review, closed, labeled] branches-ignore: - '*no-ci*' push: @@ -40,7 +40,7 @@ jobs: pick_server_suffix: runs-on: ubuntu-latest - if: github.event.action != 'closed' + if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') outputs: suffix: ${{ steps.step1.outputs.suffix }} steps: @@ -71,7 +71,7 @@ jobs: style: name: "Style Check" runs-on: ubuntu-latest - if: github.event.action != 'closed' + if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') steps: - uses: ansys/actions/code-style@v8 with: @@ -80,7 +80,7 @@ jobs: build_linux1: name: "Build linux1 wheel" runs-on: ubuntu-latest - if: github.event.action != 'closed' + if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') steps: - uses: actions/checkout@v4 @@ -111,7 +111,7 @@ jobs: matrix: test-any: ['false', 'true'] uses: ./.github/workflows/tests.yml - if: github.event.action != 'closed' + if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') needs: pick_server_suffix with: ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }} @@ -126,7 +126,7 @@ jobs: docker_tests: name: "Build and Test on Docker" uses: ./.github/workflows/test_docker.yml - if: github.event.action != 'closed' + if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') needs: pick_server_suffix with: ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }} @@ -136,7 +136,7 @@ jobs: docker_examples: name: "Run examples on Docker" uses: ./.github/workflows/examples_docker.yml - if: github.event.action != 'closed' + if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') needs: pick_server_suffix with: ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }} @@ -145,7 +145,10 @@ jobs: secrets: inherit docs: - if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) + if: | + github.event.action != 'closed' && + (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') && + (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) uses: ./.github/workflows/docs.yml needs: pick_server_suffix with: @@ -159,7 +162,11 @@ jobs: name: "Deploy PR documentation" runs-on: ubuntu-latest needs: docs - if: always() && (needs.docs.result == 'success' || needs.docs.result == 'skipped') + if: | + always() && + github.event.pull_request.draft != true && + (needs.docs.result == 'success' || needs.docs.result == 'skipped') && + contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc') steps: - uses: ansys/actions/doc-deploy-pr@v10 with: @@ -173,7 +180,10 @@ jobs: upload-development-docs: runs-on: ubuntu-latest - if: ${{ github.event.action != 'closed' && (github.ref == 'refs/heads/master' && github.event_name == 'push') }} + if: | + github.event.action != 'closed' && + (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') && + (github.ref == 'refs/heads/master' && github.event_name == 'push') needs: [docs] steps: - name: "Upload development documentation" @@ -187,7 +197,10 @@ jobs: bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} examples: - if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) + if: | + github.event.action != 'closed' && + (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') && + (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) uses: ./.github/workflows/examples.yml needs: pick_server_suffix with: @@ -198,7 +211,10 @@ jobs: pydpf-post: name: "PyDPF-Post" - if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) + if: | + github.event.action != 'closed' && + (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') && + (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) uses: ./.github/workflows/pydpf-post.yml needs: pick_server_suffix with: @@ -210,7 +226,10 @@ jobs: tests-retro: name: "Test DPF ${{ matrix.dpf.version }} compatibility" - if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) + if: | + github.event.action != 'closed' && + (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') && + (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft) strategy: fail-fast: false matrix: diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 9761cd36f58..2f152b62cda 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -17,7 +17,7 @@ jobs: steps: # Label based on modified files - - name: Label based on changed files + - name: "Label based on changed files" uses: actions/labeler@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }}