Starting and stopping the missinglink service while deploying #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to DigitalOcean Droplet | |
"on": | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to DigitalOcean Droplet | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{secrets.HOST}} | |
username: ${{secrets.USERNAME}} | |
key: ${{secrets.KEY}} | |
command_timeout: 200m | |
script: | | |
service missinglink stop | |
rm -rf missinglink | |
git clone git@github.com:allister-grange/missinglink.git | |
echo 'Deployment to digital ocean finished' | |
cd ./missinglink/backend/MissingLink.Api | |
dotnet publish -c "Release" | |
sed -i "s/Host=localhost;Database=<YOUR-DB-NAME-HERE>;Username=<YOUR-DB-USERNAME-HERE>;Password=<YOUR-DB-PASS-HERE>/${{ secrets.POSTGRES_CONNECTION_STRING }}/g" ./appsettings.json | |
sed -i "s/<METLINK-API-KEY>/${{ secrets.METLINK_API_KEY }}/g" ./appsettings.json | |
sed -i "s/<AT-API-KEY-1>/${{ secrets.ATAPIKEY1 }}/g" ./appsettings.json | |
sed -i "s/<AT-API-KEY-2>/${{ secrets.ATAPIKEY2 }}/g" ./appsettings.json | |
sed -i "s/<YOUR-REDIS-DB-HERE>/${{ secrets.REDIS_HOST }}/g" ./appsettings.json | |
service missinglink start |