Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prerelease v0.1.1 #16

Merged
merged 5 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 50 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,16 @@ name: Continuous Integration
on:
workflow_dispatch:
inputs:
source-env:
required: true
type: string
description: 'source-env'
source-project-id:
required: true
type: string
description: 'source-project-id'
source-flow-name:
required: true
type: string
description: 'source-flow-name'
source-account-username:
required: true
type: string
description: 'source-account-username'
source-account-password:
required: true
type: string
description: 'source-account-password'
destination-env:
required: true
type: string
description: 'destination-env'
destination-project-id:
required: true
type: string
description: 'destination-project-id'
destination-account-username:
required: true
input-json:
description: JSON of inputs
type: string
description: 'destination-account-username'
destination-account-password:
default: '{}'
required: true
type: string
description: 'destination-account-password'


permissions:
contents: read

jobs:
test-javascript:
name: JavaScript Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Check Format
id: npm-format-check
run: npm run format:check

- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run ci-test

test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
Expand All @@ -89,17 +26,54 @@ jobs:
id: test-action
uses: ./
with:
source-env: ${{ github.event.inputs.source-env }}
source-project-id: ${{ github.event.inputs.source-project-id }}
source-flow-name: ${{ github.event.inputs.source-flow-name }}
# Source Inputs
source-domain: ${{ fromJson(inputs.input-json).source-domain }}
source-project-id:
${{ fromJson(inputs.input-json).source-project-id }}
source-resources: ${{ fromJson(inputs.input-json).source-resources }}
# Flow Inputs
source-flow-names:
${{ fromJson(inputs.input-json).source-flow-names }}
source-flow-stage:
${{ fromJson(inputs.input-json).source-flow-stage }}
# Connector Inputs
source-connector-org-id:
${{ fromJson(inputs.input-json).source-connector-org-id }}
source-connector-group-ids:
${{ fromJson(inputs.input-json).source-connector-group-ids }}
source-connector-ids:
${{ fromJson(inputs.input-json).source-connector-ids }}
# Model Inputs
source-model-ids: ${{ fromJson(inputs.input-json).source-model-ids }}
# Template Inputs
source-template-ids:
${{ fromJson(inputs.input-json).source-template-ids }}
source-template-org-id:
${{ fromJson(inputs.input-json).source-template-org-id }}
# Webhook Inputs
source-webhook-ids:
${{ fromJson(inputs.input-json).source-webhook-ids }}
# Widget Inputs
source-widget-ids:
${{ fromJson(inputs.input-json).source-widget-ids }}
# Source Auth
source-account-username:
${{ github.event.inputs.source-account-username }}
${{ fromJson(inputs.input-json).source-account-username }}
source-account-password:
${{ github.event.inputs.source-account-password }}
destination-env: ${{ github.event.inputs.destination-env }}
${{ fromJson(inputs.input-json).source-account-password }}
# Destination Domain
destination-domain:
${{ fromJson(inputs.input-json).destination-domain }}
destination-project-id:
${{ github.event.inputs.destination-project-id }}
${{ fromJson(inputs.input-json).destination-project-id }}
# Flow Inputs
destination-flow-stage:
${{ fromJson(inputs.input-json).destination-flow-stage }}
# Template Inputs
destination-template-org-id:
${{ fromJson(inputs.input-json).destination-template-org-id }}
# Destination Auth
destination-account-username:
${{ github.event.inputs.destination-account-username }}
${{ fromJson(inputs.input-json).destination-account-username }}
destination-account-password:
${{ github.event.inputs.destination-account-password }}
${{ fromJson(inputs.input-json).destination-account-password }}
5 changes: 2 additions & 3 deletions .github/workflows/demo-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
- name: Fastn Deploy Flow
uses: fastnai/fastn-deploy-flow-action@v0.1.0
with:
source-env: ${{ vars.PROD_URI }}
source-domain: ${{ vars.PROD_URI }}
source-project-id: ${{ vars.PROD_SOURCE_PROJECT_ID }}
source-flow-name: ${{ vars.PROD_FLOW_NAMES }}
source-account-username: ${{ secrets.PROD_USERNAME }}
source-account-password: ${{ secrets.PROD_PSWD }}
destination-env: ${{ vars.PROD_URI }}
destination-domain: ${{ vars.PROD_URI }}
destination-project-id: ${{ vars.PROD_DESTINATION_PROJECT_ID }}
destination-account-username: ${{ secrets.PROD_USERNAME }}
destination-account-password: ${{ secrets.PROD_PSWD }}
5 changes: 2 additions & 3 deletions .github/workflows/demo-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
- name: Fastn Deploy Flow
uses: fastnai/fastn-deploy-flow-action@v0.1.0
with:
source-env: ${{ vars.QA_URI }}
source-domain: ${{ vars.QA_URI }}
source-project-id: ${{ vars.QA_SOURCE_PROJECT_ID }}
source-flow-name: ${{ vars.QA_FLOW_NAMES }}
source-account-username: ${{ secrets.QA_USERNAME }}
source-account-password: ${{ secrets.QA_PSWD }}
destination-env: ${{ vars.QA_URI }}
destination-domain: ${{ vars.QA_URI }}
destination-project-id: ${{ vars.QA_DESTINATION_PROJECT_ID }}
destination-account-username: ${{ secrets.QA_USERNAME }}
destination-account-password: ${{ secrets.QA_PSWD }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Fastn Deploy Flow Github Action
# Fastn Deploy Flow GitHub Action

Test Release v0.1.0
80 changes: 67 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,65 @@ author: 'Fastn Inc.'

# Define your inputs here.
inputs:
source-env:
# Source Inputs
source-domain:
description:
'Fastn environment URI from where to fetch the flow e.g. qa.fastn.ai,
'Fastn environment URI from where to fetch the resources e.g. qa.fastn.ai,
prod.fastn.ai'
required: true
source-project-id:
description: 'Project ID where the flow to deploy is present'
description: 'Project ID from where the resources will be fetched'
required: true
source-flow-name:
source-resources:
description:
'Name of the flow to deploy. For multiple flows a comma seperated list can
be used e.g. flow1,flow2'
required: true
'Type of resources to export. Currently supported "All", "Flows",
"Connectors", "Models", "Templates", "Webhooks", "Widgets"'
default: 'Connectors, Flows'
# Flow Inputs
source-flow-names:
description:
'Optional - Name of the flow to deploy. For multiple flows a comma
seperated list can be used e.g. flow1,flow2. If name is not provided all
flows will be fetched from source stage and deployed. Ignored if flows not
selected in source-resources'
source-flow-stage:
description:
'Optional - stage from where to pick the flows. e.g. QA, DRAFT, LIVE'
default: 'LIVE'
# Connector Inputs
source-connector-org-id:
description: ''
source-connector-group-ids:
description: ''
source-connector-ids:
description: ''
# Model Inputs
source-model-ids:
description:
'Optional - Name of the flow to deploy. For multiple flows a comma
seperated list can be used e.g. flow1,flow2. If name is not provided all
flows will be fetched from source stage and deployed. Ignored if flows not
selected in source-resources'
# Template Inputs
source-template-ids:
description: ''
source-template-org-id:
description: ''
# Webhook Inputs
source-webhook-ids:
description:
'Optional - Ids of the webhooks to deploy. For multiple webhooks a comma
seperated list can be used e.g. webhook1,webhook2. If id is not provided
all webhooks will be fetched from source project and copied to destinaton.
Ignored if webhooks not selected in source-resources'
# Widget Inputs
source-widget-ids:
description:
'Optional - Ids of the widgets to deploy. For multiple widgets a comma
seperated list can be used e.g. widget1,widget2. If id is not provided all
widgets will be fetched from source project and copied to destinaton.
Ignored if widgets not selected in source-resources'
# Source Auth
source-account-username:
description:
'Username of the account from where the flow to deploy is present'
Expand All @@ -25,19 +71,27 @@ inputs:
description:
'Password of the account from where the flow to deploy is present'
required: true
destination-env:
# Destination Inputs
destination-domain:
description:
'Fastn environment from where to deploy the flow e.g. qa.fastn.ai,
prod.fastn.ai'
required: true
destination-project-id:
description: 'Project ID where the flow will be deployed'
description: ''
required: true
destination-flow-name:
# Flow Inputs
destination-flow-stage:
description:
'Optional - Name of the flow to be used in the destination project. For
multiple flows a comma seperated list can be used e.g. flow1,flow2 in the
same sequence as the source flows'
'Optional - stage where to deploy the flows. e.g. QA, DRAFT, LIVE'
default: 'LIVE'
# Connector Input
destination-connector-org-id:
description: ''
# Template Inputs
destination-template-org-id:
description: ''
# Destination Auth
destination-account-username:
description: 'Username of the account where the flow will be deployed'
required: true
Expand Down
Loading
Loading