-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (32 loc) · 928 Bytes
/
deploy.yml
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
34
35
36
37
38
name: Deploy
on:
push:
branches: [main]
schedule:
- cron: "0 */4 * * *"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: swiftfiddle/swiftfiddle-lsp:latest
- uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script: |
cd swiftfiddle-lsp
git pull --rebase origin main
docker compose down
docker compose --compatibility up --force-recreate --build --detach
docker image prune --force