|
11 | 11 | branches: |
12 | 12 | - main |
13 | 13 | - 2.3.x |
| 14 | + workflow_dispatch: |
| 15 | + inputs: |
| 16 | + version: |
| 17 | + description: 'The pandas version to override' |
| 18 | + required: false |
| 19 | + type: string |
14 | 20 |
|
15 | 21 | env: |
16 | 22 | ENV_FILE: environment.yml |
17 | 23 | PANDAS_CI: 1 |
18 | 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + PANDAS_VERSION: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}" |
| 26 | + PANDAS_VERSION_OVERRIDE: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}" |
19 | 27 |
|
20 | 28 | permissions: |
21 | 29 | contents: read |
|
35 | 43 | shell: bash -el {0} |
36 | 44 |
|
37 | 45 | steps: |
| 46 | + - name: Set pandas version |
| 47 | + run: | |
| 48 | + echo "PANDAS_VERSION=${GITHUB_REF_NAME:1}" >> "$GITHUB_ENV" |
| 49 | + if: github.event_name != 'workflow_dispatch' |
| 50 | + |
| 51 | + - name: Show environment variables |
| 52 | + run: | |
| 53 | + echo "PANDAS_VERSION=${{ env.PANDAS_VERSION }}" |
| 54 | + echo "PANDAS_VERSION_OVERRIDE=${{ env.PANDAS_VERSION_OVERRIDE }}" |
| 55 | +
|
38 | 56 | - name: Checkout |
39 | 57 | uses: actions/checkout@v6 |
40 | 58 | with: |
|
72 | 90 | echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa |
73 | 91 | chmod 600 ~/.ssh/id_rsa |
74 | 92 | echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFjYkJBk7sos+r7yATODogQc3jUdW1aascGpyOD4bohj8dWjzwLJv/OJ/fyOQ5lmj81WKDk67tGtqNJYGL9acII=" > ~/.ssh/known_hosts |
75 | | - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) |
| 93 | + if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))) || github.event_name == 'workflow_dispatch' |
76 | 94 |
|
77 | 95 | - name: Copy cheatsheets into site directory |
78 | 96 | run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/ |
|
86 | 104 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
87 | 105 |
|
88 | 106 | - name: Upload prod docs |
89 | | - run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/version/${GITHUB_REF_NAME:1} |
90 | | - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') |
| 107 | + run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/version/${{ env.PANDAS_VERSION }} |
| 108 | + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && env.PANDAS_VERSION_OVERRIDE != '') |
91 | 109 |
|
92 | 110 | - name: Move docs into site directory |
93 | 111 | run: mv doc/build/html web/build/docs |
|
0 commit comments