Skip to content

Commit

Permalink
Update workflows (#95)
Browse files Browse the repository at this point in the history
* Fix logging

* Update dependency Discord.Net to v3.12.0 (#92)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix logging

* Fix merge conflict

* Update workflows

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
manuelmayer-dev and renovate[bot] authored Aug 18, 2023
1 parent 7f3ae54 commit 65fa2e5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/docker-deploy-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:

deploy:
name: Deploy Docker image
environment: staging
needs: [ci]
runs-on: ubuntu-latest
steps:
Expand All @@ -22,14 +23,14 @@ jobs:
method: 'POST'
bearerToken: ${{ secrets.TESTBOT_WEBHOOK_DEPLOY_KEY }}
customHeaders: '{"Content-Type": "application/json" }'
data: '{"toEveryone":false,"embed":{"color":{"r":0,"g":1,"b":0},"description":"MacroBot updating to ${{ github.sha }}.","fields":[{"name":"Branch","value":"Develop","inline":false},{"name":"SHA","value":"${{ github.sha }}","inline":false}]}}'
data: '{"toEveryone":false,"embed":{"color":{"r":0,"g":1,"b":0},"description":"MacroBot is updating to ${{ github.sha }}.","fields":[{"name":"Branch","value":"Develop","inline":false},{"name":"SHA","value":"${{ github.sha }}","inline":false}]}}'

- name: Updating the image on the server
uses: appleboy/[email protected]
uses: Macro-Deck-App/Actions/deploy@main
with:
host: ${{ secrets.TEST_SSH_HOST }}
username: ${{ secrets.GITHUBWORKFLOWS_USER }}
key: ${{ secrets.TEST_SSH_PRIVATE_KEY }}
script: |
cd "scripts/macro-bot/"
./update_develop.sh ${{ github.sha }}
host: ${{ secrets.TEST_DEPLOY_HOST }}
user: ${{ secrets.TEST_DEPLOY_USER }}
key: ${{ secrets.TEST_DEPLOY_KEY }}
known-hosts: ${{ secrets.TEST_DEPLOY_KNOWN_HOSTS }}
sha: ${{ github.sha }}
service: macro-bot
24 changes: 12 additions & 12 deletions .github/workflows/docker-deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ jobs:

deploy:
name: Build and deploy Docker image
environment: production
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Updating the image on the server
uses: appleboy/[email protected]
with:
host: ${{ secrets.DOCKER_HOST }}
username: ${{ secrets.GITHUBWORKFLOWS_USER }}
password: ${{ secrets.GITHUBWORKFLOWS_USER_PASSWORD }}
port: ${{ secrets.DOCKER_HOST_PORT }}
script: |
cd "scripts/macro-bot/"
./update_production.sh ${{ github.sha }}
- uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: 'https://bot.api.macro-deck.app/webhook/deploy'
method: 'POST'
bearerToken: ${{ secrets.BOT_WEBHOOK_DEPLOY_KEY }}
customHeaders: '{"Content-Type": "application/json" }'
data: '{"toEveryone":false,"embed":{"color":{"r":0,"g":1,"b":0},"description":"MacroBot is now on ${{ github.sha }}.","fields":[{"name":"Branch","value":"Develop","inline":false},{"name":"SHA","value":"${{ github.sha }}","inline":false}]}}'
data: '{"toEveryone":false,"embed":{"color":{"r":0,"g":1,"b":0},"description":"MacroBot is updating to ${{ github.sha }}.","fields":[{"name":"Branch","value":"Develop","inline":false},{"name":"SHA","value":"${{ github.sha }}","inline":false}]}}'

- name: Updating the image on the server
uses: Macro-Deck-App/Actions/deploy@main
with:
host: ${{ secrets.LIVE_DEPLOY_HOST }}
user: ${{ secrets.LIVE_DEPLOY_USER }}
key: ${{ secrets.LIVE_DEPLOY_KEY }}
known-hosts: ${{ secrets.LIVE_DEPLOY_KNOWN_HOSTS }}
sha: ${{ github.sha }}
service: macro-bot
4 changes: 2 additions & 2 deletions src/MacroBot/StartupConfig/LoggingConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static IHostBuilder ConfigureSerilog(this IHostBuilder hostBuilder)
if (MacroBotEnvironment.IsStagingOrProduction)
{
configuration
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.MinimumLevel.Override("System.Net.Http.HttpClient", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Information)
.MinimumLevel.Override("System.Net.Http.HttpClient", LogEventLevel.Information)
.WriteTo.Logger(lc =>
lc.Filter.ByIncludingOnly(Matching.FromSource("MacroBot")).WriteTo.DiscordSink(services))
.WriteTo.Logger(lc =>
Expand Down

0 comments on commit 65fa2e5

Please sign in to comment.