-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 931 Bytes
/
deploy.yml
File metadata and controls
33 lines (30 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Connect to Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Deploy to server
run: |
tailscale ssh ${{ secrets.LAKEHOUSE_USER }}@${{ secrets.LAKEHOUSE_HOST }} << 'EOF'
set -e
if [ ! -d /srv/docker/world ]; then
mkdir -p /srv/docker/world
git clone https://github.com/${{ github.repository }}.git /srv/docker/world
fi
cd /srv/docker/world
git fetch origin
git reset --hard origin/main
docker compose down
docker compose build --no-cache
docker compose up -d
EOF