-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
64 lines (59 loc) · 2.07 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
name: leptos-cloud-deploy-action
description: Deploys your app to Leptos Cloud
author: Maccesch <[email protected]>
inputs:
error:
description: 'The error message to display, if any'
required: false
default: ''
token:
description: 'The GitHub token to use for downloading the action, defaults to workflow token'
required: true
default: ${{ github.token }}
api-token:
description: 'The Leptos Cloud API token to use for deploying'
required: true
default: ${{ secrets.LEPTOS_CLOUD_TOKEN }}
cloud-config-file:
description: 'The path to the leptos-cloud.toml to use'
required: false
default: 'leptos-cloud.toml'
outputs:
error:
description: 'The description of any error that occurred'
value: ${{ steps.run.outputs.error }}
runs:
using: 'composite'
steps:
- name: Set reusable variables
shell: bash
run: |
echo "action_repo=leptos-cloud-deploy-action" >> $GITHUB_ENV
echo "action_org=Synphonyte" >> $GITHUB_ENV
echo "binary_name=leptos-cloud-deploy-action" >> $GITHUB_ENV
- name: Add binary extension
shell: bash
if: runner.os == 'Windows'
run: echo "binary_name=${{ env.binary_name }}.exe" >> $GITHUB_ENV
- name: Get Action Version
id: get_action_version
shell: pwsh
run: |
$finalComponent = Split-Path -Leaf ${{ github.action_path }}
if ($finalComponent -eq "${{ env.action_repo }}") {
$version = ""
} else {
$version = $finalComponent
}
Write-Output "version=$version" >> $Env:GITHUB_OUTPUT
- name: Download Action
shell: bash
run: |
gh release download ${{ steps.get_action_version.outputs.version }} --repo ${{ env.action_org }}/${{ env.action_repo }} --pattern '${{ runner.os }}.tgz'
tar -xzf ${{ runner.os }}.tgz
env:
GITHUB_TOKEN: ${{ inputs.token }}
- name: Run Action
shell: bash
id: run
run: ./${{ runner.os }}/${{ env.binary_name }} "${{ inputs.error }}" "${{ inputs.api-token }}" "${{ inputs.cloud-config-file }}"