Skip to content

sync

sync #578

Workflow file for this run

name: sync
on:
schedule:
- cron: '30 20 * * 1-5'
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Build
run: CGO_ENABLED=0 go build -o app
- name: Dump JSON Files
run: ./app json -d
- name: Tar JSON Files
run: tar czvf jsons.tar.gz ./*.json
- name: Scp JSON Files
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
port: ${{ secrets.REMOTE_PORT }}
key: ${{ secrets.SERVER_SSH_KEY }}
source: 'jsons.tar.gz'
target: ${{ secrets.REMOTE_TARGET }}
- name: SSH Remote Commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
port: ${{ secrets.REMOTE_PORT }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: cd ${{ secrets.REMOTE_TARGET }} && tar xzvf jsons.tar.gz