Skip to content

Auto upload deploy.sh to gsocket.io/y #33

Auto upload deploy.sh to gsocket.io/y

Auto upload deploy.sh to gsocket.io/y #33

Workflow file for this run

name: Auto upload deploy.sh to gsocket.io/x
on:
push:
branches:
- master
paths:
- deploy/deploy.sh
workflow_dispatch:
jobs:
build:
name: Deploy to WWW
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy.sh https://gsocket.io
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
run: |
cp deploy/deploy.sh /tmp/y
cp deploy/deploy_server.sh /tmp/ys
mkdir ~/.ssh && echo "$SSH_DEPLOY_KEY" >~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
cd /tmp/
git clone -b gh-pages --single-branch [email protected]:hackerschoice/gsocket.io.git
cd gsocket.io
cmp -s /tmp/y y || {
cat /tmp/y >y
cat /tmp/y >x
git config --local user.name "GitHub Action"
git config --local user.email "[email protected]"
git add x y && git commit -m "deploy x" && git push
}