actions-vps-mirror/.github/workflows/runglobal.yml

82 lines
3.2 KiB
YAML
Raw Normal View History

2024-10-03 23:44:27 -04:00
name: Runs Global
on:
workflow_dispatch:
inputs:
runNext:
description: 'Should run next'
required: true
default: true
type: boolean
permissions: write-all
jobs:
custom:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v5
with:
# pagekite doesn't work with >=3.12
# the version that pagekite said in the docs was 2.7
# but since setup-python removed 2.7 i have to use 3.11,
# which surprisingly works
python-version: '3.11'
- name: Installs stuff
run: |
sudo apt update -y
sudo apt install git wget docker-compose mosh -y
curl -fsSL https://tailscale.com/install.sh | sh
echo "$(whoami):password1!" | sudo chpasswd
sudo tailscale up --hostname=global --advertise-exit-node --ssh --authkey ${{ secrets.TAILSCALE_KEY }}
2024-10-03 23:44:27 -04:00
sed -i 's/unset .*//g' $HOME/.bashrc
sed -i 's/#force_color_prompt/force_color_prompt/g' $HOME/.bashrc
echo 'source $HOME/.bashrc' | sudo tee -a /etc/profile
- name: Copy the files
run: |
sudo pkill provjobd
cd /tmp
wget -O archive.zip https://codeload.github.com/CeciliaKelley33Mm/CeciliaKelley33Mm.github.io/zip/refs/heads/main
unzip archive.zip
- name: Set everything up
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
CHANGE_COMMAND_USERNAME: ${{ secrets.CHANGE_COMMAND_USERNAME }}
CHANGE_COMMAND_PASSWORD: ${{ secrets.CHANGE_COMMAND_PASSWORD }}
2024-10-03 23:44:27 -04:00
run: |
2024-10-04 01:41:40 -04:00
mkdir /tmp/muse
cd /tmp/muse
2024-10-05 07:34:43 -04:00
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/muse-compose.yml
2024-10-04 01:41:40 -04:00
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 &
2024-10-05 07:34:43 -04:00
mkdir /tmp/minecraft
cd /tmp/minecraft
wget -O docker-compose.yml https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/minecraft-compose.yml
docker compose up -d &
2024-10-03 23:44:27 -04:00
cd /tmp/CeciliaKelley33Mm.github.io-main/backend
npm i
node index.js &
curl -O https://pagekite.net/pk/pagekite.py
2024-10-04 04:32:55 -04:00
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/.pagekite.rc
2024-10-03 23:44:27 -04:00
cp .pagekite.rc ~
sed -i 's*KITENAMEPK*${{ secrets.KITENAME }}*g' ~/.pagekite.rc
sed -i 's*KITESECRETPK*${{ secrets.KITESECRET }}*g' ~/.pagekite.rc
python pagekite.py &
2024-10-04 04:24:51 -04:00
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/loop.sh
2024-10-04 00:35:56 -04:00
chmod +x loop.sh
bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master global $WEBHOOK_URL