Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Update ru.ts

Update ru.ts #631

Workflow file for this run

# Copyright (C) 2021-2023 Technology Matters
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see https://www.gnu.org/licenses/.
name: Webchat Dev Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Setup credentials to access AWS for parameters
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "us-east-1"
- name: Set ACCOUNT_SID
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/development/twilio/AS/account_sid"
env_variable_name: "ACCOUNT_SID"
- name: Set IP_FIND_API_KEY
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "IP_FIND_API_KEY"
env_variable_name: "IP_FIND_API_KEY"
- name: Set SERVERLESS_URL
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/development/serverless/${{ env.ACCOUNT_SID }}/base_url"
env_variable_name: "SERVERLESS_URL"
- name: Set RECAPTCHA_KEY
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/global/google/recaptcha/site_key"
env_variable_name: "RECAPTCHA_KEY"
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
# Create and fill secret.ts
- name: Create secret.ts
run: |
touch ./private/secret.ts
- name: Fill secret.ts
run: |
cat <<EOT >> ./private/secret.ts
export const API_KEY = '${{ env.IP_FIND_API_KEY }}';
export const SERVERLESS_URL = '${{ env.SERVERLESS_URL }}';
export const RECAPTCHA_KEY = '${{ env.RECAPTCHA_KEY }}';
export const RECAPTCHA_VERIFY_URL = 'https://hrm-development.tl.techmatters.org/lambda/recaptchaVerify'
EOT
# Run a single command using the runners shell to install dependencies
- name: Install dependencies
run: npm ci
# Get the blockedIps for this account
- name: Get blockedIps
run: curl -o ./src/blockedIps.json https://tl-public-chat-as-dev.s3.amazonaws.com/blockedIps.json
shell: bash
# Build and compile Webchat
- name: Run build command
run: CONFIG=as-development npm run build
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create secret.ts
run: |
touch ./private/secret.ts
- name: Install dependencies
run: npm install eslint
# Run linting
- name: Run ESLint
run: npm run lint --if-present
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Run Tests
run: npm run test