-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
72 lines (66 loc) · 2.25 KB
/
action.yml
File metadata and controls
72 lines (66 loc) · 2.25 KB
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
name: oxyde-cloud-deploy-action
description: Deploys your app to Oxyde Cloud
author: Maccesch <maccesch@synphonyte.com>
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 Oxyde Cloud API token to use for deploying'
required: true
cloud-config-file:
description: 'The path to the oxyde-cloud.toml to use'
required: false
default: 'oxyde-cloud.toml'
debug:
description: 'Enable debug logging'
required: false
default: ''
outputs:
error:
description: 'The description of any error that occurred'
value: ${{ steps.run.outputs.error }}
runs:
using: 'composite'
steps:
- name: Check if api-token is set
shell: bash
run: |
[[ "${{ inputs.api-token }}" ]] || { echo "api-token is not set" ; exit 1; }
- name: Set reusable variables
shell: bash
run: |
echo "action_repo=oxyde-cloud-deploy-action" >> $GITHUB_ENV
echo "action_org=Synphonyte" >> $GITHUB_ENV
echo "binary_name=oxyde-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: bash
run: |
finalComponent=$(basename "${{ github.action_path }}")
if [ "$finalComponent" = "${{ env.action_repo }}" ]; then
version=""
else
version="$finalComponent"
fi
echo "version=$version" >> "$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 }}" "${{ inputs.debug }}"