@@ -15,24 +15,21 @@ jobs:
1515 - uses : actions/checkout@v3
1616 with :
1717 submodules : recursive
18- - name : Commit and push changes
19- run : |
20- git config --global user.name "CD bot"
21- git config --global user.email ""
22- echo %date% %time% >> App_Data\dbtestfile.txt
23- git add App_Data\dbtestfile.txt
24- git commit -m "update db file [skip actions]"
25- git push
18+
2619 - name : Setup .NET
2720 uses : actions/setup-dotnet@v3
2821 with :
2922 dotnet-version : 6.0.x
23+
3024 - name : Restore dependencies
3125 run : dotnet restore
26+
3227 - name : Build
33- run : dotnet build --no-restore
28+ run : dotnet build --no-restore
29+
3430 - name : Test
3531 run : dotnet test --no-build --verbosity normal
32+
3633 - name : App Settings Variable Substitution
3734 uses : microsoft/variable-substitution@v1
3835 with :
@@ -45,39 +42,58 @@ jobs:
4542 MailerSettings.Port : ${{ secrets.MAILER_SETTINGS_PORT }}
4643 MailerSettings.EnableSSL : ${{ secrets.MAILER_SETTINGS_ENABLESSL }}
4744 Token.Secret : ${{ secrets.TOKEN_SECRET }}
48- - name : Publish
49- run : dotnet publish HamEvent/HamEvent.csproj --configuration Release --framework net7.0 --output ./publish --runtime win-x64 --self-contained true -p:PublishTrimmed=false -p:PublishSingleFile=false
45+
5046 - name : Stop App Pool
51- uses : bogdanbrudiu/simply-web-deploy/Stop@7f9e096
47+ uses : bogdanbrudiu/simply-web-deploy/Stop@main
5248 with :
5349 website-name : ${{ secrets.WEBSITE_NAME }}
5450 server-computer-name : ${{ secrets.SERVER_COMPUTER_NAME }}
5551 server-username : ${{ secrets.SERVER_USERNAME }}
5652 server-password : ${{ secrets.SERVER_PASSWORD }}
53+
5754 - name : Fetch App Pool
58- uses : bogdanbrudiu/simply-web-deploy/Fetch@7f9e096
55+ uses : bogdanbrudiu/simply-web-deploy/Fetch@main
5956 with :
6057 website-name : ${{ secrets.WEBSITE_NAME }}
6158 server-computer-name : ${{ secrets.SERVER_COMPUTER_NAME }}
6259 server-username : ${{ secrets.SERVER_USERNAME }}
6360 server-password : ${{ secrets.SERVER_PASSWORD }}
61+ target-path : ' \fetched\'
62+ source-path : ' ""'
63+
6464 - name : Backup DB
6565 run : |
6666 git config --global user.name "CD bot"
6767 git config --global user.email ""
68- echo %date% %time% >> App_Data\dbtestfile_.txt
69- git add App_Data\dbtestfile.txt
68+ copy fetched/App_Data/QSOs.db HamEvent/App_Data/QSOs.db
69+ $NOW=& Get-Date -format yyyy-MM-dd
70+ echo "New backup done on $NOW" >> HamEvent/App_Data/dbbackup_log
71+ git add HamEvent/App_Data/QSOs.db
72+ git add HamEvent/App_Data/dbbackup_log
7073 git commit -m "update db file [skip actions]"
71- git push
74+
75+ - name : Push change
76+ uses : ad-m/github-push-action@master
77+ with :
78+ github_token : ${{ secrets.GITHUB_TOKEN }}
79+ branch : ${{ github.ref }}
80+
81+ - name : Publish
82+ run : dotnet publish HamEvent/HamEvent.csproj --configuration Release --framework net8.0 --output ./publish --runtime win-x64 --self-contained true -p:PublishTrimmed=false -p:PublishSingleFile=false
83+
84+
7285 - name : Deploy App Pool
73- uses : bogdanbrudiu/simply-web-deploy/Deploy@7f9e096
86+ uses : bogdanbrudiu/simply-web-deploy/Deploy@main
7487 with :
7588 website-name : ${{ secrets.WEBSITE_NAME }}
7689 server-computer-name : ${{ secrets.SERVER_COMPUTER_NAME }}
7790 server-username : ${{ secrets.SERVER_USERNAME }}
7891 server-password : ${{ secrets.SERVER_PASSWORD }}
92+ target-path : ' \wwwroot\'
93+ source-path : ' \publish\'
94+
7995 - name : Start App Pool
80- uses : bogdanbrudiu/simply-web-deploy/Start@7f9e096
96+ uses : bogdanbrudiu/simply-web-deploy/Start@main
8197 with :
8298 website-name : ${{ secrets.WEBSITE_NAME }}
8399 server-computer-name : ${{ secrets.SERVER_COMPUTER_NAME }}
0 commit comments