Skip to content

Initial configuration #2

Initial configuration

Initial configuration #2

Workflow file for this run

name: ci
on: push
jobs:
deploy:
if: ${{ false }} # disable for now
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up NodeJS environment
uses: actions/setup-node@v2
with:
node-version: 16
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install package dependencies
run: npm install
- name: Create build
env:
CI: false
REACT_APP_MAIN_SERVER_URL: ${{ secrets.REACT_APP_MAIN_SERVER_URL }}
REACT_APP_WEBSOCKET_URL: ${{ secrets.REACT_APP_WEBSOCKET_URL }}
REACT_APP_SENTRY_ENVIRONMENT: ${{ secrets.REACT_APP_SENTRY_ENVIRONMENT }}
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }}
REACT_APP_GOOGLE_CLIENT_ID: ${{ secrets.REACT_APP_GOOGLE_CLIENT_ID }}
run: npm run build
- name: rsync deployments
uses: burnett01/[email protected]
with:
switches: -ahv --no-o --no-g --progress --delete --exclude=".git" --exclude="node_modules" --exclude=".env"
remote_path: /root/template-frontend
remote_host: ${{ secrets.SSH_HOST }}
remote_port: ${{ secrets.SSH_PORT }}
remote_user: ${{ secrets.SSH_USERNAME }}
remote_key: ${{ secrets.SSH_KEY }}
- uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
bash -ci 'pm2 restart client'