Initial commit

This commit is contained in:
2022-04-18 10:10:45 +02:00
commit ae79b544cb
9 changed files with 289 additions and 0 deletions

40
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Deploy to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Build
- name: Pull latest changes on VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: cd ${{ secrets.VPS_PROJECT_PATH }} && git fetch && git checkout main && git pull
- name: Build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: cd ${{ secrets.VPS_PROJECT_PATH }} && docker-compose run mkdocswiki build
# Deploy
- name: Deploy new image and cleanup
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: docker-compose -f ~/docker-compose.yml up -d && docker image prune -af