Update docker github actions (#649) #193
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: 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 |