2022-08-04 00:20:13 +03:00
|
|
|
name: Test and deploy server and webapp
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
2022-08-04 11:44:09 +03:00
|
|
|
test:
|
|
|
|
name: Run tests
|
|
|
|
uses: mcndt/noteshare.space/.github/workflows/test.yaml@master
|
2022-08-04 00:20:13 +03:00
|
|
|
deploy:
|
|
|
|
name: Deploy
|
2022-08-04 11:44:09 +03:00
|
|
|
needs: [test]
|
2022-08-05 14:08:08 +03:00
|
|
|
environment:
|
|
|
|
name: production
|
|
|
|
url: https://noteshare.space
|
2022-08-04 00:20:13 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Deploy using ssh
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.DEPLOY_HOST }}
|
|
|
|
username: ${{ secrets.DEPLOY_USER }}
|
|
|
|
key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
|
|
|
|
port: 22
|
2022-08-04 11:42:35 +03:00
|
|
|
script_stop: true
|
2022-08-04 00:20:13 +03:00
|
|
|
script: |
|
|
|
|
cd /home/noteshare/noteshare.space
|
|
|
|
git pull origin master
|
|
|
|
docker compose -f docker-compose.server.yml build
|
|
|
|
docker compose -f docker-compose.server.yml up -d
|