Develop #4
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 workflow | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- master | |
jobs: | |
deploy: | |
if: | | |
github.event.pull_request.merged == true && | |
github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote ssh commands to deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USER }} | |
key: ${{ secrets.SSH_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
script: | | |
[ ! -d together-for-life ] && git clone https://github.com/Studio-Yandex-Practicum/together-for-life.git | |
cd together-for-life | |
git pull | |
docker compose down | |
echo VK_TOKEN=${{ secrets.VK_TOKEN }} > .env | |
echo ADMIN_ID=${{ secrets.ADMIN_ID }} >> .env | |
echo MENU_EDIT_KEY_WORD=${{ secrets.MENU_EDIT_KEY_WORD }} >> .env | |
docker compose up --build -d | |