This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathaction.yml
79 lines (66 loc) · 2.47 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Deta Space Deployment Github Action
description: Github Action for deploying Deta Space apps.
branding:
icon: upload-cloud
color: purple
inputs:
access_token:
description: Deta access token for Deta Space CLI authentication.
required: true
project_id:
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
experimental:
description: Whether to use the experimental runner version for space push. Valid value is "true".
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.
required: false
runs:
using: composite
steps:
- name: Install Deta Space CLI & set SPACE_ACCESS_TOKEN environment variable
shell: bash
run: |
curl -fsSL https://get.deta.dev/space-cli.sh | sh
echo "$HOME/.detaspace/bin" >> $GITHUB_PATH
echo "SPACE_ACCESS_TOKEN=${{ inputs.access_token }}" >> $GITHUB_ENV
- name: Push changes to Deta Space
if: ${{ inputs.space_push == 'true' }}
shell: bash
run: |
cd ${{ inputs.project_directory }}
space link --id "${{ inputs.project_id }}"
if [[ ${{ inputs.experimental }} == true ]]; then
space push --runner-version experimental
else
space push
fi
- name: Create a release on Deta Space
if: ${{ inputs.space_release == 'true' }}
shell: bash
run: |
cd ${{ inputs.project_directory }}
space link --id "${{ inputs.project_id }}"
if [[ ${{ inputs.list_on_discovery }} == true ]]; then
space release --version "${{ inputs.release_version }}" --listed --confirm
else
space release --version "${{ inputs.release_version }}" --confirm
fi