Merge pull request #319 from fiit-tp-tim20/main #117
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 | |
on: | |
push: | |
branches: | |
- prod | |
jobs: | |
git_pull: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: unnecessary | |
- name: Deploy backend and frontend | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
cd ~/SAIP | |
git pull origin prod | |
build_fe: | |
runs-on: ubuntu-latest | |
needs: git_pull | |
if: ${{ !contains(github.event.head_commit.message, '#beonly') }} | |
steps: | |
- name: Deploy backend and frontend | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
cd ~/SAIP/apps/saip-fe | |
yarn | |
yarn run build | |
cp dist /var/www/ -r | |
bash ~/manage_services.sh --restart | |
build_be: | |
runs-on: ubuntu-latest | |
needs: git_pull | |
if: ${{ !contains(github.event.head_commit.message, '#feonly') }} | |
steps: | |
- name: Deploy backend | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
cd ~/SAIP | |
cp apps/saip_be /var/www/ -r | |
bash ~/manage_services.sh --restart |