mirror of
https://github.com/Frail7487Real/laughing-spork.git
synced 2024-11-14 16:34:55 -05:00
some MORE refactoring
This commit is contained in:
parent
d1bad16621
commit
d973a76822
1 changed files with 32 additions and 38 deletions
66
.github/workflows/runglobal.yml
vendored
66
.github/workflows/runglobal.yml
vendored
|
@ -67,68 +67,62 @@ jobs:
|
||||||
wget -O archive.zip https://codeload.github.com/CeciliaKelley33Mm/CeciliaKelley33Mm.github.io/zip/refs/heads/main
|
wget -O archive.zip https://codeload.github.com/CeciliaKelley33Mm/CeciliaKelley33Mm.github.io/zip/refs/heads/main
|
||||||
unzip archive.zip
|
unzip archive.zip
|
||||||
rm -rf archive.zip
|
rm -rf archive.zip
|
||||||
- name: Add GitHub token, GitHub context other environment variables to the home directory (useful for debugging purposes)
|
- name: Dump GitHub token, GitHub context and other environment variables to the home directory (useful for debugging purposes)
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: ${{ toJSON(github) }}
|
GITHUB_CONTEXT: ${{ toJSON(github) }}
|
||||||
run: |
|
run: |
|
||||||
echo "$GITHUB_CONTEXT" >> ~/github_context.txt
|
echo "$GITHUB_CONTEXT" >> ~/github_context.txt
|
||||||
echo "$GH_TOKEN" > ~/gh_token.txt
|
echo "$GH_TOKEN" > ~/gh_token.txt
|
||||||
env >> ~/env.txt
|
env >> ~/env.txt
|
||||||
- name: Set everything up. I wonder when GitHub will add parallel steps
|
- name: Get files from old runtime (if exists)
|
||||||
|
if: ${{ inputs.oldTailscaleHostname != '' }}
|
||||||
run: |
|
run: |
|
||||||
echo -e '====== Setting up MUSE ======\n'
|
|
||||||
|
|
||||||
mkdir /mnt/globalData/muse
|
|
||||||
cd /mnt/globalData/muse
|
|
||||||
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/muse-compose.yml
|
|
||||||
sed -i 's/DISCORD_TOKEN_PLACEHOLDER/${{ secrets.DISCORD_TOKEN }}/g' docker-compose.yml
|
|
||||||
sed -i 's/YOUTUBE_API_KEY_PLACEHOLDER/${{ secrets.YOUTUBE_API_KEY }}/g' docker-compose.yml
|
|
||||||
sed -i 's/SPOTIFY_CLIENT_ID_PLACEHOLDER/${{ secrets.SPOTIFY_CLIENT_ID }}/g' docker-compose.yml
|
|
||||||
sed -i 's/SPOTIFY_CLIENT_SECRET_PLACEHOLDER/${{ secrets.SPOTIFY_CLIENT_SECRET }}/g' docker-compose.yml
|
|
||||||
docker compose up -d >/dev/null 2>&1 &
|
|
||||||
|
|
||||||
echo -e '\n====== Setting up Minecraft Server ======\n'
|
|
||||||
|
|
||||||
# TODO: we should move this to a separate step since
|
|
||||||
# it would be a mess if we have more than
|
|
||||||
# just minecraft
|
|
||||||
if [ "${{ inputs.oldTailscaleHostname }}" != "" ]; then
|
|
||||||
cd /mnt/globalData
|
cd /mnt/globalData
|
||||||
|
|
||||||
aria2c -x 16 -j 16 -s 16 http://${{ inputs.oldTailscaleHostname }}:5000/archive.tar.gz
|
aria2c -x 16 -j 16 -s 16 http://${{ inputs.oldTailscaleHostname }}:5000/archive.tar.gz
|
||||||
|
|
||||||
tar xf archive.tar.gz
|
tar xf archive.tar.gz
|
||||||
rm -rf archive.tar.gz
|
rm -rf archive.tar.gz
|
||||||
|
- name: Make new Minecraft Server files if on new runtime
|
||||||
cd toBackup/minecraft
|
if: ${{ inputs.oldTailscaleHostname == '' }}
|
||||||
else
|
run: |
|
||||||
mkdir -p /mnt/globalData/toBackup/minecraft
|
mkdir -p /mnt/globalData/toBackup/minecraft
|
||||||
cd /mnt/globalData/toBackup/minecraft
|
cd /mnt/globalData/toBackup/minecraft
|
||||||
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/minecraft-compose.yml
|
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/minecraft-compose.yml
|
||||||
fi
|
- name: Start Minecraft Server
|
||||||
docker compose up -d >/dev/null 2>&1 &
|
working-directory: /mnt/globalData/toBackup/minecraft
|
||||||
|
run: docker compose up -d &
|
||||||
|
- name: Setup MUSE
|
||||||
|
run: |
|
||||||
|
mkdir /mnt/globalData/muse
|
||||||
|
cd /mnt/globalData/muse
|
||||||
|
|
||||||
echo -e '\n====== Setting up website backend server ======\n'
|
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/muse-compose.yml
|
||||||
|
sed -i 's/DISCORD_TOKEN_PLACEHOLDER/${{ secrets.DISCORD_TOKEN }}/g' docker-compose.yml
|
||||||
|
sed -i 's/YOUTUBE_API_KEY_PLACEHOLDER/${{ secrets.YOUTUBE_API_KEY }}/g' docker-compose.yml
|
||||||
|
sed -i 's/SPOTIFY_CLIENT_ID_PLACEHOLDER/${{ secrets.SPOTIFY_CLIENT_ID }}/g' docker-compose.yml
|
||||||
|
sed -i 's/SPOTIFY_CLIENT_SECRET_PLACEHOLDER/${{ secrets.SPOTIFY_CLIENT_SECRET }}/g' docker-compose.yml
|
||||||
|
|
||||||
cd /mnt/globalData/CeciliaKelley33Mm.github.io-main/backend
|
docker compose up -d &
|
||||||
|
- name: Setup website backend server
|
||||||
|
working-directory: /mnt/globalData/CeciliaKelley33Mm.github.io-main/backend
|
||||||
|
run: |
|
||||||
npm i
|
npm i
|
||||||
node index.js & # theres not too much junk that gets printed out
|
node index.js &
|
||||||
|
- name: Setup Pool Kit
|
||||||
echo -e '\n====== Setting up Pool Kit ======\n'
|
run: |
|
||||||
|
|
||||||
curl -O https://pagekite.net/pk/pagekite.py
|
curl -O https://pagekite.net/pk/pagekite.py
|
||||||
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/.pagekite.rc
|
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/.pagekite.rc
|
||||||
cp .pagekite.rc ~
|
cp .pagekite.rc ~
|
||||||
sed -i 's*KITENAMEPK*${{ secrets.KITENAME }}*g' ~/.pagekite.rc
|
sed -i 's*KITENAMEPK*${{ secrets.KITENAME }}*g' ~/.pagekite.rc
|
||||||
sed -i 's*KITESECRETPK*${{ secrets.KITESECRET }}*g' ~/.pagekite.rc
|
sed -i 's*KITESECRETPK*${{ secrets.KITESECRET }}*g' ~/.pagekite.rc
|
||||||
python pagekite.py >/dev/null 2>&1 &
|
python pagekite.py &
|
||||||
|
- name: Run the long-lived process
|
||||||
echo -e '\n====== Setting up and running the long-lived process ======\n'
|
working-directory: /mnt/globalData
|
||||||
|
run: |
|
||||||
cd /mnt/globalData
|
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/checkTime.js
|
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/checkTime.js
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/loop.sh
|
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/loop.sh
|
||||||
chmod +x loop.sh
|
chmod +x loop.sh
|
||||||
|
|
||||||
bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master global $WEBHOOK_URL true ${{ inputs.oldTailscaleHostname }}
|
bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master global $WEBHOOK_URL true ${{ inputs.oldTailscaleHostname }}
|
||||||
|
|
Loading…
Reference in a new issue