Transfer #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Transfer | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '26 12 * * *' | |
watch: | |
types: | |
- started | |
fork: | |
workflow_dispatch: | |
jobs: | |
run-transfer-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Create .env file | |
run: | | |
echo "ACCESS_TOKEN=${{ secrets.ACCESS_TOKEN }}" >> .env | |
echo "REPO_OWNER=${{ secrets.REPO_OWNER }}" >> .env | |
echo "REPO_NAME=${{ secrets.REPO_NAME }}" >> .env | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: | | |
- recursive: true | |
args: [--frozen-lockfile, --strict-peer-dependencies] | |
- name: Setup SSH | |
run: | | |
mkdir ~/.ssh | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -H ${{ secrets.CLOUD }} >> ~/.ssh/known_hosts | |
- name: Run transfer script | |
run: | | |
chmod +x transfer.sh | |
CLOUD=${{ secrets.CLOUD }} bash transfer.sh |