Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
feat: add project directory on spacefile as input option
Browse files Browse the repository at this point in the history
  • Loading branch information
heytorvas committed Mar 2, 2023
1 parent 00b1df0 commit b62b70d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Thanks for the help ✨ [Sponge](https://github.com/rohanshiva).

- `project_id` : Used for getting the *.space folder* for pushing your code to Deta Space. To get your project id go to the [Builder](https://alpha.deta.space/builder) and in your project’s *Develop* tab, open the *teletype* (command bar) and copy the *Project ID*.

- `project_directory` : (Optional) The directory where your project is located. The default value is the root directory.

- `space_push` : (Optional) If true, pushes your changes to Space and creates a new revision. The default value is false.

- `space_release` : (Optional) If true, the latest revision will be released to Space. The default value is false.
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@ inputs:
description: Deta Space app project ID.
required: true

project_directory:
description: Directory of the Deta Space project.
required: false
default: "."

space_push:
description: Whether to do space push. Valid value is "true". Space push will not be performed by default.
required: false
default: false

space_release:
description: Whether to do space release without listing the revision on Space Discovery. Valid value is "true". Space release will not be performed by default.
required: false
default: false

list_on_discovery:
description: Whether to list the latest revision on Space Discovery. Valid value is "true". Listing on Space Discovery will not be performed by default.
required: false
default: false

release_version:
description: Version for the release. If not provided, Deta Space will generate a version by default.
Expand All @@ -45,12 +53,14 @@ runs:
if: ${{ inputs.space_push == 'true' }}
shell: script -q -e -c "bash {0}"
run: |
cd ${{ inputs.project_directory }}
space push --id "${{ inputs.project_id }}"
- name: Create a release on Deta Space
if: ${{ inputs.space_release == 'true' }}
shell: script -q -e -c "bash {0}"
run: |
cd ${{ inputs.project_directory }}
if [[ ${{ inputs.list_on_discovery }} == true ]]; then
space release --id "${{ inputs.project_id }}" --version "${{ inputs.release_version }}" --listed --confirm
else
Expand Down

0 comments on commit b62b70d

Please sign in to comment.