Update README.md #25
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: Deploy Queue to Preview Environment | |
on: | |
push: | |
branches: [ preview ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{secrets.SSH_PRIVATE_KEY}} | |
known_hosts: 'placeholder' | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H ${{ secrets.SSH_HOST_IP }} >> ~/.ssh/known_hosts | |
- name: Move to machine with rsync | |
run: rsync -avz /home/runner/work/q-prime/q-prime ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_IP }}:/home/${{ secrets.SSH_USER }}/q-dev/ | |
- name: Deploy to preview environment and restart | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST_IP }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/${{ secrets.SSH_USER }}/q-dev | |
./restart_preview.sh | |