diff --git a/README.md b/README.md index 333ab13..7598e62 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ The inputs this action uses are: | `create_postgres` | `false` | None | True to create a Postgres instance for the app. | | `create_persistent_filesystem` | `false` | None | True to create a persistent filesystem for the app. | | `de_client_version` | `false` | None | Version of the Dash Enterprise client to install. If not provided, the latest version will be installed. | +| `python_version` | `false` | `3.10` | Python version to use for the deployment. If not provided, Python 3.10 will be used. | ### Preview deploy on pull request This action will deploy branches using the `on: pull_request: types: ['opened', 'edited', 'synchronize', 'closed']` trigger as `https://${DE_HOST}/${APP_NAME}-${event_number}`, e.g. if you are deploying an app called `inventory-analytics` to `example.plotly.host` and your PR number is `15`, the deploy preview would be available at `https://example.plotly.host/inventory-analytics-15` and would be redeployed on every new commit to that PR. diff --git a/action.yml b/action.yml index 129dbd5..67875fe 100644 --- a/action.yml +++ b/action.yml @@ -50,6 +50,11 @@ inputs: required: false default: '' type: string + python_version: + description: Python version to use for the deployment. If not provided, Python 3.10 will be used. + required: false + default: '3.10' + type: string @@ -60,7 +65,7 @@ runs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.10' + python-version: ${{ inputs.python_version }} - name: Install de-client shell: bash run: | @@ -113,6 +118,15 @@ runs: -H "X-GitHub-Api-Version: 2022-11-28"\ https://api.github.com/repos/${{ github.repository }}/statuses/${{github.event.pull_request.head.sha || github.sha}}\ -d '{"state":"success","target_url":"https://${{ inputs.DE_HOST }}/apps/${{ steps.app_name.outputs.app_name }}","description":"App manager ready!","context":"deploy/${{ steps.app_name.outputs.app_name }}"}' + - name: Set Python version + shell: bash + if: ${{ inputs.python_version }} + run: | + de --no-keyfile apps update --name ${{ steps.app_name.outputs.app_name }} --python-version ${{ inputs.python_version }} + env: + DASH_ENTERPRISE_HOST: ${{inputs.DE_HOST}} + DASH_ENTERPRISE_PASSWORD: ${{inputs.DE_PASSWORD}} + DASH_ENTERPRISE_USERNAME: ${{inputs.DE_USERNAME}} - name: Create Redis shell: bash if: ${{ inputs.create_redis }}