This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
Merge branch 'main' of https://github.com/SalamLang/Salam-Editor #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Deploy and Run Commands via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
password: ${{ secrets.SERVER_PASSWORD }} | |
port: ${{ secrets.SERVER_PORT }} | |
script: | | |
cd ${{ secrets.SERVER_PATH }} | |
git fetch --all | |
git pull | |
# Create a random variable for unique clone directory | |
variable=cache$RANDOM | |
echo "Cloning repository to: clone-${variable}" | |
git clone https://github.com/SalamLang/Salam clone-${variable} | |
cd clone-${variable} | |
cd src | |
# Run the WebAssembly build script | |
echo "Running build-webassembly.sh..." | |
bash build-webassembly.sh | |
# Check if the WebAssembly files were built and copy them | |
if [ -f "salam-wa.wasm" ] && [ -f "salam-wa.js" ]; then | |
echo "Copying salam-wa.wasm and salam-wa.js to the parent directory." | |
cp salam-wa.wasm ../../ | |
cp salam-wa.js ../../ | |
else | |
echo "salam-wa.wasm or salam-wa.js not found. Skipping." | |
fi | |
# Cleanup cloned directory | |
cd ../.. | |
rm -rf clone-${variable} | |
echo "Cleanup completed: clone-${variable} removed." |