-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 2.2 KB
/
docker-deploy.yaml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build and Push Docker Image
on:
push:
branches: [ master ]
paths:
- "GuildWarsPartySearch.Common/**"
- "GuildWarsPartySearch/**"
- ".github/workflows/docker-deploy.yaml"
jobs:
build:
runs-on: ubuntu-latest
# steps:
# - name: Check out the repository
# uses: actions/checkout@v2
# - name: Install .NET Core
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: '8.x'
# - name: Log in to Docker Hub
# run: |
# docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
# - name: Create Docker Environment File
# shell: pwsh
# run: |
# cd GuildWarsPartySearch
# $envFilePath = "envfile"
# $envContent = @(
# "ServerOptions__ApiKey=${{ secrets.APIKEY }}",
# "ServerOptions__Certificate=${{ secrets.CERTIFICATE_BASE64 }}",
# "ApplicationInsights__InstrumentationKey=${{ secrets.AZURE_INSIGHTS_INSTRUMENTATIONKEY }}",
# "AzureCredentialsOptions__ClientSecret=${{ secrets.AZURE_CLIENT_SECRET }}",
# "AzureCredentialsOptions__ClientId=${{ secrets.AZURE_CLIENT_ID }}",
# "AzureCredentialsOptions__TenantId=${{ secrets.AZURE_TENANT_ID }}"
# )
# $envContent | Set-Content -Path $envFilePath
# Write-Host "Environment file created: $envFilePath"
# - name: Build and push Docker image
# run: |
# cd GuildWarsPartySearch
# .\BuildDockerImage.ps1
# docker push alex4991/guildwarspartysearch.server
# shell: pwsh
# - name: Create Private Key File
# run: |
# cd GuildWarsPartySearch
# $privateKeyContent = "${{ secrets.HOST_KEY }}"
# Set-Content -Path private.key -Value $privateKeyContent
# shell: pwsh
# - name: Set Private Key permissions
# run: |
# cd GuildWarsPartySearch
# chmod 400 private.key
# shell: bash
# - name: Deploy Docker image to host
# shell: pwsh
# run: |
# cd GuildWarsPartySearch
# .\DeployToVM.ps1 -KeyFile private.key -User ${{ secrets.HOST_USER }} -Address ${{ secrets.HOST_ADDRESS }} -PathToEnvFileFolder .