Skip to content

small change to share url #218

small change to share url

small change to share url #218

Workflow file for this run

name: Deploy Website
on:
push:
branches:
- main # Or your default branch
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout Vortex Engine
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetches all history for all branches and tags
repository: 'StoneOrbits/VortexEngine'
path: 'VortexEngine'
ref: 'desktop'
# Build Vortex CLI Tool
- name: Build Vortex CLI Tool
run: |
cd VortexEngine/VortexEngine/VortexCLI
make -j
# Install Emscripten dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 nodejs cmake
# Install Emscripten
- name: Install Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
# Build using Emscripten
- name: Build WebAssembly with Emscripten
run: |
source emsdk/emsdk_env.sh
cd VortexEngine/VortexEngine/VortexLib
make clean
make -j wasm
# Cache build artifacts
- name: Cache VortexLib Build Artifacts
uses: actions/cache@v3
with:
path: |
VortexEngine/VortexEngine/VortexLib/VortexLib.js
VortexEngine/VortexEngine/VortexLib/VortexLib.wasm
key: VortexLib-${{ github.sha }}
# checkout actual repo for sake of version generation
- name: Checkout Main Repository
uses: actions/checkout@v3
with:
path: 'lightshow.lol'
fetch-depth: 0 # Fetch all history for tags and commits
# Determine version from Git tags and generate version.js
- name: Generate Version
run: |
cd lightshow.lol # Move into the repository directory
# Get the latest tag (ensures it's a proper version number)
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
# Count commits since the tag
COUNT=$(git rev-list $TAG..HEAD --count)
# Ensure TAG is in X.Y.Z format
if [[ ! $TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid TAG format: $TAG. Using default 0.0.0"
TAG="0.0.0"
fi
# Extract MAJOR, MINOR, PATCH
IFS='.' read -r MAJOR MINOR PATCH <<< "$TAG"
# Ensure variables are integers
MAJOR=$((MAJOR + 0))
MINOR=$((MINOR + 0))
PATCH=$((PATCH + 0))
COUNT=$((COUNT + 0))
# Calculate new PATCH version
NEW_PATCH=$((PATCH + COUNT))
# Construct the final version
VERSION="$MAJOR.$MINOR.$NEW_PATCH"
# cd back out to generate the version
cd -
# Output version to version.js
echo "export const VERSION = '$VERSION';" > version.js
echo "Generated Version: $VERSION"
- name: Setup SSH Agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Add Linode to known_hosts
run: ssh-keyscan 172.232.170.43 >> ~/.ssh/known_hosts
- name: Deploy to Linode
run: |
scp VortexEngine/VortexEngine/VortexLib/VortexLib.js [email protected]:/home/lightshow/lightshow.lol/js/VortexLib.js
scp VortexEngine/VortexEngine/VortexLib/VortexLib.wasm [email protected]:/home/lightshow/lightshow.lol/js/VortexLib.wasm
scp VortexEngine/VortexEngine/VortexCLI/vortex [email protected]:/home/lightshow/vortex
scp version.js [email protected]:/home/lightshow/lightshow.lol/js/version.js
ssh [email protected] 'sudo /usr/bin/mv /home/lightshow/vortex /usr/local/bin/vortex'
#ssh [email protected] 'sudo systemctl stop lightshow.lol'
ssh [email protected] 'cd /home/lightshow/lightshow.lol && git reset --hard && git pull && chmod +x ./add_cache_busters.sh && ./add_cache_busters.sh'
#ssh [email protected] 'sudo systemctl start lightshow.lol'