-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathaction.yml
50 lines (45 loc) · 1.46 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
name: "Deploy to Deta"
description: "Simple GitHub Action to deploy current repo to a Deta Micro"
inputs:
deta-access-token:
description: "Deta access token"
required: true
deta-name:
description: "Deta micro name"
required: true
deta-project:
description: "Deta project name"
default: "default"
deta-project-dir:
description: "Directory of the project"
default: "."
runs:
using: "composite"
steps:
# Install Deta CLI as per docs
# https://docs.deta.sh/docs/cli/install
- name: Install Deta CLI
shell: bash
run: |
curl -fsSL https://get.deta.dev/cli.sh | sh
# Using the access token and existing Deta micro and project,
# clone the micro and copy .deta metadata folder to use it in deploy
# https://docs.deta.sh/docs/cli/commands#deta-clone
- name: Clone Deta Metadata
shell: bash
run: |
export DETA_ACCESS_TOKEN=${{ inputs.deta-access-token }}
cd ${{ inputs.deta-project-dir }}
~/.deta/bin/deta clone --name ${{ inputs.deta-name }} --project ${{ inputs.deta-project }} tmp/
cp -r tmp/.deta .
# Using the access token, deploy the project to Deta
# https://docs.deta.sh/docs/cli/commands#deta-deploy
- name: Deploy to Deta
shell: bash
run: |
export DETA_ACCESS_TOKEN=${{ inputs.deta-access-token }}
cd ${{ inputs.deta-project-dir }}
~/.deta/bin/deta deploy
branding:
icon: check-circle
color: purple