-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a sub-workflow which can be dispatched generically to deploy an Elide sample or app. Changes enclosed: - Add deployment sub-workflow - Use it from regular build
- Loading branch information
Showing
3 changed files
with
163 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,49 @@ | ||
frontend: | ||
- any: ["graalvm*/**/*"] | ||
all: ["module:graalvm"] | ||
- any: ["frontend/**/*"] | ||
all: ["module:frontend"] | ||
- any: ["rpc/**/*"] | ||
all: ["module:rpc"] | ||
- any: ["server/**/*"] | ||
all: ["module:server"] | ||
- any: ["base/**/*"] | ||
all: ["module:base"] | ||
# | ||
# Labels: Generic | ||
# | ||
"tools": | ||
- any: ["tools/**/*"] | ||
"release": | ||
- all: [".version", "README.md"] | ||
|
||
# | ||
# Labels: Platform | ||
# | ||
"platform:jvm": | ||
- any: ["packages/base/**/*"] | ||
- any: ["packages/graalvm/**/*"] | ||
- any: ["packages/model/**/*"] | ||
- any: ["packages/rpc/**/*", "packages/rpc-jvm/**/*"] | ||
- any: ["packages/server/**/*"] | ||
"platform:browser": | ||
- any: ["packages/base/**/*"] | ||
- any: ["packages/frontend/**/*"] | ||
|
||
# | ||
# Labels: Modules | ||
# | ||
"module:base": | ||
- any: ["packages/base/**/*"] | ||
"module:graalvm": | ||
- any: | ||
[ | ||
"packages/graalvm/**/*", | ||
"packages/graalvm-js/**/*", | ||
"packages/graalvm-react/**/*", | ||
] | ||
"module:model": | ||
- any: ["packages/model/**/*"] | ||
"module:rpc": | ||
- any: ["packages/rpc/**/*", "packages/rpc-jvm/**/*", "packages/rpc-js/**/*"] | ||
"module:server": | ||
- any: ["packages/server/**/*"] | ||
"module:frontend": | ||
- any: ["packages/frontend/**/*"] | ||
|
||
# | ||
# Labels: CI Triggers | ||
# | ||
"ci:build-img-jvm": | ||
- any: ["samples/**/*.kt"] | ||
"ci:build-img-native": | ||
- any: ["samples/**/*.kt"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Deployment | ||
|
||
concurrency: | ||
group: "deploy" | ||
cancel-in-progress: false | ||
|
||
on: | ||
## Deployment can be invoked from other workflows. | ||
workflow_call: | ||
inputs: | ||
## Path to the app to deploy. | ||
path: | ||
description: "Path" | ||
required: true | ||
default: "samples/fullstack/react-ssr" | ||
type: string | ||
|
||
## Environment to update with this deployment. | ||
environment: | ||
description: "Target" | ||
type: string | ||
required: true | ||
|
||
## URL target for this deployment. | ||
url: | ||
description: "URL" | ||
type: string | ||
required: true | ||
|
||
## Optional image tag to deploy. If not specified, the "latest" image will be deployed. | ||
image: | ||
description: "Image" | ||
type: string | ||
required: false | ||
|
||
secrets: | ||
FLY_API_TOKEN: | ||
required: true | ||
|
||
## Deployment can be triggered manually. | ||
workflow_dispatch: | ||
inputs: | ||
path: | ||
description: "Site" | ||
required: true | ||
default: "samples/fullstack/react-ssr" | ||
type: choice | ||
options: | ||
- samples/fullstack/react-ssr | ||
environment: | ||
description: "Target" | ||
type: environment | ||
required: true | ||
url: | ||
description: "URL" | ||
type: string | ||
required: true | ||
image: | ||
description: "Image" | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
deployment: | ||
name: "Deploy (${{ inputs.environment }})" | ||
runs-on: "ubuntu-latest" | ||
environment: ${{ inputs.environment }} | ||
concurrency: "deploy-${{ inputs.environment }}" | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
checks: "write" | ||
pull-requests: "write" | ||
statuses: "write" | ||
deployments: "write" | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
steps: | ||
## Setup: Checkout Code | ||
- name: "Setup: Checkout" | ||
uses: actions/checkout@v3 | ||
|
||
## Setup: Fly | ||
- name: "Setup: Fly" | ||
uses: superfly/flyctl-actions/setup-flyctl@master | ||
|
||
## Deploy: App | ||
- name: "Deploy: Fly (${{ inputs.environment }})" | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
run: | | ||
cd ${{ inputs.path }} && flyctl deploy --remote-only ${{ inputs.image != '' && format('--image {0}', inputs.image) || '' }}; |