From 20c96bca592acb427c73cb23c67546cf9f9fc225 Mon Sep 17 00:00:00 2001 From: Alw3ys Date: Sat, 28 Oct 2023 12:57:05 +0200 Subject: [PATCH] feat: github action --- README.md | 23 ++++++++++++++++++++++- action.yaml | 24 ++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 action.yaml diff --git a/README.md b/README.md index ce0f349..ad289a9 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,32 @@ Login into deployplex to start using the CLI: dctl login ``` -Alternatively you can use a deployplex token generated from the console and set it as an environment variable. +Alternatively you can use a deployplex token generated from the dashboard and set it as an environment variable. ```bash export DEPLOYPLEX_TOKEN="you_deployplex_token" ``` +## Usage + +On the terminal +```bash +dctl --help +``` + +On Github Actions +```yaml +steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup dctl CLI + uses: deployplex/dctl@0.0.11 + with: + token: ${{ secrets.DEPLOYPLEX_TOKEN }} + # https://pypi.org/project/dctl/#history version. (Not required); Defaults to `latest` if not provided + cli-version: latest +``` + ## Learn more The best place to get started is following our getting started guide on the [DeployPlex CLI Documentation](https://docs.deployplex.com/cli). diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..8d7085e --- /dev/null +++ b/action.yaml @@ -0,0 +1,24 @@ +name: "Setup dctl" +description: 'Setup dctl (DeployPlex CLI) in your Github Actions workflow.' +author: DeployPlex + +branding: + icon: 'box' + color: 'black' + +inputs: + token: + description: 'Your DeployPlex token.' + required: false + +runs: + using: "composite" + steps: + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - run: python3 -m pip install dctl==0.0.11 + shell: bash + - run: echo "DEPLOYPLEX_TOKEN=${{ inputs.token }}" >> $GITHUB_ENV + if: ${{ inputs.token }} + shell: bash diff --git a/pyproject.toml b/pyproject.toml index 6fb8338..db1786b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dctl" -version = "0.0.10" +version = "0.0.11" description = "Command Line Interface (CLI) for DeployPlex" authors = ["Alvaro Molina "] license = "Apache-2.0"