Skip to content

feat: Nutrients knowledge panel kickstart (#624) #554

feat: Nutrients knowledge panel kickstart (#624)

feat: Nutrients knowledge panel kickstart (#624) #554

name: Preprod Deployment CI
on:
push:
branches:
- main
- deploy-*
tags:
- v*.*.*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
# same concurrency as off-server staging deployment
environment: off-net
concurrency: off-net
steps:
- name: Checkout git repository
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
proxy_host: ${{ secrets.PROXY_HOST }}
proxy_username: ${{ secrets.USERNAME }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
script_stop: false
script: |
# Clone Git repository if not already there
[ ! -d '${{ matrix.env }}' ] && git clone --depth 1 https://github.com/${{ github.repository }} off-web-net --no-single-branch 2>&1
# Go to repository directory
cd off-web-net
# Fetch newest commits (in case it wasn't freshly cloned)
git fetch --depth 1
# Checkout current commit SHA
git checkout -qf ${{ github.sha }}
# we need to restart staging backend to see deployed changes
- name: Restart staging backend
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
proxy_host: ${{ secrets.PROXY_HOST }}
proxy_username: ${{ secrets.USERNAME }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
# Go to repository directory and restart backend
cd off-net
docker compose restart backend