Skip to content

Merge branch 'cookies' into development #30

Merge branch 'cookies' into development

Merge branch 'cookies' into development #30

on:
push:
branches:
- "development"
workflow_dispatch:
name: Publish Development
jobs:
publishDevStudio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Write config file
run: |
#!/bin/bash
PACKAGE_VERSION=$(sed -nr 's/^\s*\"version": "([0-9]{1,}\.[0-9]{1,}.*)",$/\1/p' package.json)
cat <<EOF > ./src/config/index.js
export default {
env: 'stage',
stripe_public_key: '${{secrets.STRIPE_PUBLIC_KEY}}',
lms_api_url: 'https://dev.harperdbcloudservices.com/',
google_analytics_code: '${{secrets.GOOGLE_ANALYTICS_CODE}}',
youtube_api_key: '${{secrets.YOUTUBE_API_KEY}}',
postman_collection_url: 'https://www.postman.com/collections/7046690-5a70b340-8fe1-4487-88bd-ffac077c3df8',
tc_version: '2020-01-01',
check_version_interval: 300000,
refresh_content_interval: 15000,
total_cloud_instance_limit: 10,
free_cloud_instance_limit: 1,
total_local_instance_limit: false,
free_local_instance_limit: false,
max_file_upload_size: 10380902,
studio_version:'$PACKAGE_VERSION',
user_guide_id: 16032,
alarm_badge_threshold: 86400,
maintenance: 0,
errortest: 0
};
EOF
- name: Write manifest file
run: |
#!/bin/bash
cat <<EOF > ./public/manifest.json
{
"short_name": "HarperDB Studio",
"name": "HarperDB Studio",
"icons": [
{
"src": "favicon.ico",
"sizes": "16x16",
"type": "image/x-icon"
},
{
"src": "images/logo_vertical_white.png",
"type": "image/png",
"sizes": "536x672"
}
],
"start_url": "https://dev.studio.harperdb.io",
"display": "standalone",
"theme_color": "#480b8a",
"background_color": "#ffffff"
}
EOF
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.16.0
- name: Build
run: |
#!/bin/bash
yarn
yarn build:dev
- name: Clean Remote Directory
env:
CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }}
run: |
#!/bin/bash
echo "$CI_PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -i private_key -o ConnectTimeout=10 -o ConnectionAttempts=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR [email protected] \
"rm -rf /home/ubuntu/sites/studio-dev/*"
- name: Copy built files
env:
CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }}
run: |
#!/bin/bash
scp -r -i private_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \
build/* "[email protected]:/home/ubuntu/sites/studio-dev/"