Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
118 lines (113 loc) · 4.01 KB
/
Copy pathaction.yml
File metadata and controls
118 lines (113 loc) · 4.01 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: "Flyte deploy"
description:
"Deploy a Flyte environment with the flyte CLI (via uv), authenticating with a
client id and secret passed as inputs; pull requests deploy with --dry-run
unless register-on-pr is set."
author: "DataLabHell"
branding:
icon: "send"
color: "blue"
# Installs uv (via setup-uv) and runs the flyte CLI with the client credentials
# from the inputs. Everything the CLI needs is passed as a command option rather
# than a config file, so a repo only has to say what it deploys. The caller owns
# the job (runner, checkout).
inputs:
environment:
description:
'What to deploy — the trailing arguments of "flyte deploy", e.g.
"my_pkg/workflows.py" or "--all my_pkg/workflows.py".'
required: true
project:
description: "Flyte project to deploy into."
required: true
domain:
description:
'Flyte domain(s) to deploy into. Takes a list — comma, space or newline
separated (e.g. "development,production") — and deploys the same version
to each in order.'
required: false
default: "development"
endpoint:
description: "Flyte admin endpoint."
required: false
default: "dns:///flyte.apps.dlh-k8s.com"
org:
description: "Flyte organization."
required: false
default: "flyte"
version:
description:
"Version to deploy. Defaults to the commit sha. Used as passed on main; a
pull request registered with register-on-pr always gets the short sha
appended."
required: false
default: ""
register-on-pr:
description:
'Register for real on pull requests instead of dry running them. The
version always gets "-<short-sha>" appended, so a PR registration never
collides with a main deploy.'
required: false
default: "false"
dry-run:
description:
'"auto" (dry run on pull_request events unless register-on-pr is true,
never otherwise), "true" (always) or "false" (never).'
required: false
default: "auto"
extra-args:
description: 'Extra args appended to "flyte deploy" before the environment.'
required: false
default: ""
working-directory:
description: "Directory to run the deploy from."
required: false
default: "."
client-id:
description: "OAuth client id of the deploy client."
required: true
client-secret:
description: "OAuth client secret of the deploy client."
required: true
client-scope:
description:
"OAuth scope requested for the client credentials grant. Empty = whatever
the admin endpoint advertises."
required: false
default: ""
outputs:
version:
description: "The version that was deployed."
value: ${{ steps.deploy.outputs.version }}
dry-run:
description: '"true" if the deploy ran with --dry-run.'
value: ${{ steps.deploy.outputs.dry-run }}
domains:
description: "The domains that were deployed to, space separated."
value: ${{ steps.deploy.outputs.domains }}
runs:
using: "composite"
steps:
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Deploy to Flyte
id: deploy
shell: bash
working-directory: ${{ inputs.working-directory }}
run: bash "${{ github.action_path }}/deploy.sh"
env:
INPUT_ENVIRONMENT: ${{ inputs.environment }}
INPUT_PROJECT: ${{ inputs.project }}
INPUT_DOMAIN: ${{ inputs.domain }}
INPUT_ENDPOINT: ${{ inputs.endpoint }}
INPUT_ORG: ${{ inputs.org }}
INPUT_VERSION: ${{ inputs.version }}
INPUT_REGISTER_ON_PR: ${{ inputs.register-on-pr }}
INPUT_DRY_RUN: ${{ inputs.dry-run }}
INPUT_EXTRA_ARGS: ${{ inputs.extra-args }}
# On pull requests GITHUB_SHA is the temporary merge commit of
# refs/pull/<n>/merge, not the commit that was pushed.
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
FLYTE_CLIENT_ID: ${{ inputs.client-id }}
FLYTE_CLIENT_SECRET: ${{ inputs.client-secret }}
FLYTE_CLIENT_SCOPE: ${{ inputs.client-scope }}