Skip to content

Merge pull request #8 from Capibara-Tools/JustinWoodring-patch-2 #48

Merge pull request #8 from Capibara-Tools/JustinWoodring-patch-2

Merge pull request #8 from Capibara-Tools/JustinWoodring-patch-2 #48

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: japgolly/[email protected]
# Runs a set of commands using the runners shell
- name: Build clientapp
run: |
cd clientapp
npm install
CI=false npm run build
echo "Copy build to Play Server"
ls
mv ./build ../capibara-website/public/clientapp
- name: Build server
run: |
cd capibara-website
export SOURCE_DATE_EPOCH=`date +%s`
echo "Building for $SOURCE_DATE_EPOCH"
sbt dist
- if: ${{ github.event_name == 'push' }}
name: Publish to capibara.tools
env:
CAPIBARA_WEBSITE_SSH_KEY: ${{ secrets.CAPIBARA_TOOLS_USER_SSH_KEY }}
run: |
mkdir ../keys
cd ../keys
echo "$CAPIBARA_WEBSITE_SSH_KEY" > capibara_website_ssh_key
chmod 600 capibara_website_ssh_key
mkdir ~/.ssh
ssh-keyscan -t rsa capibara.tools >> ~/.ssh/known_hosts
cd ../website/capibara-website/target/universal
scp -i ../../../../keys/capibara_website_ssh_key capibara-website-1.0-SNAPSHOT.zip [email protected]:dist.zip
ssh -i ../../../../keys/capibara_website_ssh_key [email protected] 'bash < /home/capibara/redeploy_script.sh'
echo "All Done"