-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNotifon.Deploy.proj
39 lines (34 loc) · 1.65 KB
/
Notifon.Deploy.proj
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
39
<Project DefaultTargets="Deploy">
<PropertyGroup>
<Server>[email protected]</Server>
<ServerPath>~/notifon/</ServerPath>
<ImageName>ghcr.io/ton-actions/notifon:latest</ImageName>
<ImagesPrune>false</ImagesPrune>
<FullStack>false</FullStack>
</PropertyGroup>
<Target Name="Build" BeforeTargets="Push">
<Exec Command="docker build . -t $(ImageName)" />
</Target>
<Target Name="Push">
<Exec Command="docker push $(ImageName)" />
</Target>
<Target Name="Deploy">
<PropertyGroup Condition="$(FullStack)">
<FullCompose>-f docker-compose.vpn.yaml</FullCompose>
</PropertyGroup>
<PropertyGroup>
<Compose>--compatibility -f docker-compose.yaml -f docker-compose.cluster.yaml $(FullCompose)</Compose>
<Ssh>ssh -y $(Server)</Ssh>
</PropertyGroup>
<Exec Command="rsync -zvrc --exclude=".env" --exclude="nginx/ssl" --exclude="firebase-key.json" .docker-compose/* $(Server):$(ServerPath)" />
<Exec Command="$(Ssh) "cd $(ServerPath);docker-compose $(Compose) pull"" />
<Exec Command="$(Ssh) "cd $(ServerPath);docker-compose $(Compose) up --remove-orphans -d"" />
<Exec Command="$(Ssh) "cd $(ServerPath);docker-compose $(Compose) exec -T nginx nginx -s reload"" />
<Exec Command="$(Ssh) "docker image prune -f"" Condition="$(ImagesPrune)" />
</Target>
<ItemGroup>
<Content Include="Dockerfile" />
<Content Include=".docker-compose/**" />
<Content Include=".github/**" />
</ItemGroup>
</Project>