Product Deploy #39
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: Product Deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
product-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Загрузка репозитория | |
uses: actions/checkout@v2 | |
- name: Установка ключа для пользователя | |
run: | | |
set -eu | |
mkdir "$HOME/.ssh" | |
chmod 700 "$HOME/.ssh" | |
echo "${{ secrets.DEPLOY_KEY }}" > "$HOME/.ssh/id_rsa" | |
chmod 600 "$HOME/.ssh/id_rsa" | |
- name: Развёртывание приложения | |
run: | | |
CONTENT_PATH="/web/sites/search.doka.guide/www" | |
PORT=8070 | |
ssh-keyscan -H api.doka.guide >> ~/.ssh/known_hosts | |
export DOCKER_HOST="ssh://[email protected]" | |
docker stop search | |
docker image rm search | |
docker build -t search . | |
docker run -dti --rm -p "$PORT":"$PORT" --name search --mount type=bind,source="$CONTENT_PATH",target=/app/data search --search-content data/search-content.json --stop-words data/stop-search.json --dicts-dir data/dics --app-port "$PORT" |