Skip to content

Deploy to Flex

Deploy to Flex #51

Workflow file for this run

name: Deploy to Flex
on:
workflow_dispatch:
inputs:
environment:
required: true
type: environment
description: "Environment to use for deployment"
deploy_icons_plugin:
required: true
type: boolean
default: false
description: Deploy UI Icons Plugin?
jobs:
deploy-serverless:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_KEY: ${{ secrets.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
GOOGLECHAT_STUDIO_FLOW_SID: ${{ secrets.GOOGLECHAT_STUDIO_FLOW_SID }}
GOOGLECHAT_SERVICE_ACCOUNT_KEY_BASE64: ${{ secrets.GOOGLECHAT_SERVICE_ACCOUNT_KEY_BASE64 }}
INSTAGRAM_STUDIO_FLOW_SID: ${{ secrets.INSTAGRAM_STUDIO_FLOW_SID }}
INSTAGRAM_APP_SECRET: ${{ secrets.INSTAGRAM_APP_SECRET }}
INSTAGRAM_PAGE_ACCESS_TOKEN: ${{ secrets.INSTAGRAM_PAGE_ACCESS_TOKEN }}
INSTAGRAM_WEBHOOK_VERIFY_TOKEN: ${{ secrets.INSTAGRAM_WEBHOOK_VERIFY_TOKEN }}
LINE_STUDIO_FLOW_SID: ${{ secrets.LINE_STUDIO_FLOW_SID }}
LINE_CHANNEL_ID: ${{ secrets.LINE_CHANNEL_ID }}
LINE_CHANNEL_SECRET: ${{ secrets.LINE_CHANNEL_SECRET }}
LINE_CHANNEL_ACCESS_TOKEN: ${{ secrets.LINE_CHANNEL_ACCESS_TOKEN }}
VIBER_STUDIO_FLOW_SID: ${{ secrets.VIBER_STUDIO_FLOW_SID }}
VIBER_AUTH_TOKEN: ${{ secrets.VIBER_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js v18
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install NPM packages
id: install-npm
working-directory: serverless-functions
run: |
npm install
npm run install-serverless-plugin
- name: Setup Environment
id: setup-environment
working-directory: serverless-functions
run: |
npm run setup-environment $ENVIRONMENT
- name: Deploy to Environment
id: deploy-to-environment
working-directory: serverless-functions
run: |
npm run deploy-env
deploy-icons-plugin:
if: |
github.event.inputs.deploy_icons_plugin == 'true'
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_KEY: ${{ secrets.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js v18
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install NPM packages
id: install-npm
working-directory: plugin-conversations-icons
run: |
npm install
npm run install-flex-plugin
- name: Deploy to Environment
id: deploy-to-environment
working-directory: plugin-conversations-icons
run: |
npm run deploy -- --changelog="Deploy from CI/CD for commit ${{ github.sha }}"
npm run release -- --name="Release from CI/CD for commit ${{ github.sha }}" --description="Release from CI/CD for commit ${{ github.sha }}"