diff --git a/README.md b/README.md index 5edbc94..97fa915 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: plotly/de-deploy@v2 + - uses: plotly/de-deploy@main with: DE_HOST: ${{ secrets.DE_HOST }} DE_USERNAME: ${{ secrets.DE_USERNAME }} @@ -55,6 +55,7 @@ The inputs this action uses are: | `create_redis` | `false` | None | True to create a Redis instance for the app. | | `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. | +| `env_vars` | `false` | None | Environment variables to add. Separate multiple variables with a space. Example: `env_vars: "FOO=BAR FOO_SECRET=${{ secrets.FOO_SECRET }}"` | ### 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 90cbfe7..4bc8925 100644 --- a/action.yml +++ b/action.yml @@ -28,7 +28,7 @@ inputs: group_viewers: description: User groups to add as viewers to the app. If not provided, no groups will be added. required: false - type: strong + type: string group_co_owners: description: User groups to add as co-owners to the app. If not provided, no groups will be added. type: boolean @@ -45,9 +45,7 @@ inputs: description: True to create a persistent filesystem for the app. type: boolean required: false - - - + runs: using: composite steps: @@ -101,6 +99,11 @@ 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 environment variables + run: | + name=${{ matrix.env_var.name }} + value=${{ matrix.env_var.value }} + de --no-keyfile apps update --name ${{ steps.app_name.outputs.app_name }} --add-environment-variable "$name=$value" - name: Create Redis shell: bash if: ${{ inputs.create_redis }} @@ -154,7 +157,6 @@ runs: DASH_ENTERPRISE_HOST: ${{inputs.DE_HOST}} DASH_ENTERPRISE_USERNAME: ${{inputs.DE_USERNAME}} - branding: icon: activity color: purple