Skip to content

Merge pull request #654 from kitspace/ke/search-url-delay #196

Merge pull request #654 from kitspace/ke/search-url-delay

Merge pull request #654 from kitspace/ke/search-url-delay #196

name: Copy import script
on:
push:
paths:
- 'scripts/importBoardsTxt.ts'
- '.github/workflows/copy-import-script.yml'
branches: [abdo-dev, kaspar-dev, review, master]
jobs:
copy_import_script:
runs-on: ubuntu-22.04
environment: staging
steps:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: mkdir target
- uses: actions/checkout@v4
- name: Compile the script
run: deno compile --allow-env --allow-net --allow-run --target x86_64-unknown-linux-gnu --output target/importBoardsTxt scripts/importBoardsTxt.ts --githubToken ${{ secrets.IMPORT_SCRIPT_ACCESS_TOKEN }}
- name: Copy the script to host
run: |
echo -e '${{ secrets.STAGING_SSH_PRIVATE_KEY }}' > key-file
chmod 600 key-file
rsync --archive --compress --update --delete --recursive -e 'ssh -i key-file -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' target/ 'deploy@${{ github.ref_name }}.staging.kitspace.dev:target'
- name: Make the script executable on host
uses: appleboy/ssh-action@master
with:
host: ${{ github.ref_name }}.staging.kitspace.dev
username: deploy
key: ${{ secrets.STAGING_SSH_PRIVATE_KEY }}
script: |
cd /home/deploy && mv target/importBoardsTxt importBoardsTxt && chmod +x importBoardsTxt && rm -rf target