Skip to content

manually create this too #26

manually create this too

manually create this too #26

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" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: main
cancel-in-progress: true
# 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
with:
path: tf/download
- uses: zerotier/github-action@v1
with:
auth_token: ${{ secrets.ZEROTIER_KEY }}
network_id: e4da7455b253a261
# Install wakeonlan
- name: Make scripts executable
run: sudo apt-get install -y wakeonlan
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.DEPLOY_KEY }}"
- name: Create asset pack
run: |
mv 'tf/download/.github/HOW TO INSTALL!.gif' .
{
zip -r gg2-assets.zip tf -x '*/.*' -x '*.bz2' -x 'tf_mvm_missioncycle.res'
zip gg2-assets.zip 'HOW TO INSTALL!.gif'
} &
{
zip -r gg2-assets-no-maps.zip tf -x '*/.*' -x '*.bz2' -x 'tf/download/maps/*' -x 'tf_mvm_missioncycle.res'
zip gg2-assets-no-maps.zip 'HOW TO INSTALL!.gif'
} &
wait
rm 'HOW TO INSTALL!.gif'
- name: Upload to R2
uses: jakejarvis/s3-sync-action@master
with:
args: --exclude '*' --include '*.zip' --follow-symlinks --delete
env:
AWS_S3_BUCKET: fastdl-gg2
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_REGION: 'auto' # optional: defaults to us-east-1
AWS_S3_ENDPOINT: https://d7d00000029f3cf361b520329f5e69df.r2.cloudflarestorage.com
- name: Create bz2 archives
run: |
cd tf/download
find . -type f -not \( -name "*.pop" -or -name "*.nav" -or -name "*.res" -or -name "*.bz2" -or -name "*.lua" -or -name "*.nut" \) \( ! -regex '.*/\..*' \) | parallel bzip2 -f -k
- name: Sync with game servers
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
for i in "2244 pterodactyl@eu9.potato.tf a0:d3:c1:5d:16:a5"; do a=( $i );
{
ssh -o StrictHostKeyChecking=no -p ${a[0]} ${a[1]} wakeonlan ${a[2]}
} &
done
wait
cd tf/download
for i in "22 pterodactyl@us.potato.tf" "22 pterodactyl@sgp.potato.tf" "22 pterodactyl@eu2.potato.tf" "27035 pterodactyl@eu.potato.tf" "22 pterodactyl@10.243.40.231" "2244 pterodactyl@eu9.potato.tf" "22 pterodactyl@aus.potato.tf"; do a=( $i );
{
ssh -o StrictHostKeyChecking=no -p ${a[0]} ${a[1]} "touch /var/tf2server/tf/occupiedservers/wake; exit 0"
rsync -a -e "ssh -p ${a[0]} -o StrictHostKeyChecking=no" --delete --update --exclude=".*" --exclude="*.bz2" . ${a[1]}:/var/tf2server/tf/gg2/
ssh -p ${a[0]} -o StrictHostKeyChecking=no ${a[1]} mkdir -p /var/www/html/gameassets/gg2
rsync -a -e "ssh -p ${a[0]} -o StrictHostKeyChecking=no" --delete --update --include="*/" --include="*.bz2" --exclude="*" . ${a[1]}:/var/www/html/gameassets/gg2/
} &
done
wait