@@ -49,19 +49,29 @@ jobs:
49
49
echo "TAG_NAME=${{ github.event.inputs.version }}" >> $GITHUB_ENV
50
50
fi;
51
51
52
+ - name : setup .net core
53
+ uses : actions/setup-dotnet@v3
54
+ with :
55
+ dotnet-version : ' 8.*'
56
+
57
+ - name : Install x tool
58
+ run : dotnet tool install -g x
59
+
60
+ - name : Apply Production AppSettings
61
+ working-directory : ./BlazorDiffusion
62
+ run : |
63
+ cat <<EOF >> appsettings.json.patch
64
+ ${{ secrets.APPSETTINGS_PATCH }}
65
+ EOF
66
+ x patch appsettings.json.patch
67
+
52
68
- name : Login to GitHub Container Registry
53
69
uses : docker/login-action@v2
54
70
with :
55
71
registry : ghcr.io
56
72
username : ${{ github.actor }}
57
73
password : ${{ secrets.GITHUB_TOKEN }}
58
-
59
74
60
- - name : Setup dotnet
61
- uses : actions/setup-dotnet@v3
62
- with :
63
- dotnet-version : ' 8.*'
64
-
65
75
# Build and push new docker image, skip for manual redeploy other than 'latest'
66
76
- name : Build and push Docker image
67
77
run : |
@@ -103,6 +113,8 @@ jobs:
103
113
echo "APP_NAME=${{ github.event.repository.name }}" >> .deploy/.env
104
114
echo "IMAGE_REPO=${{ env.image_repository_name }}" >> .deploy/.env
105
115
echo "RELEASE_VERSION=${{ env.TAG_NAME }}" >> .deploy/.env
116
+ echo "R2_ACCESS_KEY_ID=${{ secrets.R2_ACCESS_KEY_ID }}" >> .deploy/.env
117
+ echo "R2_SECRET_ACCESS_KEY=${{ secrets.R2_SECRET_ACCESS_KEY }}" >> .deploy/.env
106
118
107
119
# Copy only the docker-compose.yml to remote server home folder
108
120
- name : copy files to target server via scp
@@ -115,7 +127,28 @@ jobs:
115
127
strip_components : 2
116
128
source : " ./.deploy/docker-compose.yml,./.deploy/.env"
117
129
target : " ~/.deploy/${{ github.event.repository.name }}/"
118
-
130
+
131
+ # Populate litestream.yml with variables from build process, including TAG_NAME.
132
+ - name : litestream.yml file prep
133
+ uses :
danielr1996/[email protected]
134
+ env :
135
+ R2_ACCESS_KEY_ID : ${{ secrets.R2_ACCESS_KEY_ID }}
136
+ R2_SECRET_ACCESS_KEY : ${{ secrets.R2_SECRET_ACCESS_KEY }}
137
+ with :
138
+ input : .deploy/litestream-template.yml
139
+ output : .deploy/litestream.yml
140
+
141
+ - name : copy litestream.yml file via scp
142
+
143
+ with :
144
+ host : ${{ secrets.DEPLOY_HOST }}
145
+ username : ${{ secrets.DEPLOY_USERNAME }}
146
+ port : 22
147
+ strip_components : 1
148
+ key : ${{ secrets.DEPLOY_KEY }}
149
+ source : " .deploy/litestream.yml"
150
+ target : " .deploy/${{ github.event.repository.name }}/config"
151
+
119
152
- name : Run remote db migrations
120
153
121
154
env :
0 commit comments