Skip to content

Debug

Debug #148

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@v3
- 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: |
dig '${{ github.ref_name }}.staging.kitspace.dev'
echo -e '${{ secrets.STAGING_SSH_PRIVATE_KEY }}' > key-file
chmod 600 key-file
cat 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