Skip to content

removed login suffix #414

removed login suffix

removed login suffix #414

Workflow file for this run

name: CI/CD
on:
push:
branches: [master]
pull_request:
types: [opened, reopened, synchronize]
branches: [master]
workflow_dispatch:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
jobs:
ShouldDeploy:
runs-on: ubuntu-latest
outputs:
Bot: ${{ steps.filter.outputs.Bot }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Paths filter
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Bot:
- 'src/**'
CheckStaticContent:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Markdown lint
uses: nosborn/[email protected]
with:
files: .
- name: Check json content
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/json-lint/master/pipeline.sh)
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Crosscheck JSON content
run: python3 CI/check-texts.py
BuildBot:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
source-url: https://nuget.pkg.github.com/GrillBot/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install dependencies
run: |
dotnet restore -r linux-x64 src/GrillBot.Common/
dotnet restore -r linux-x64 src/GrillBot.Cache/
dotnet restore -r linux-x64 src/GrillBot.Database/
dotnet restore -r linux-x64 src/GrillBot.Data/
dotnet restore -r linux-x64 src/GrillBot.App/
- name: Build (RELEASE)
run: dotnet build -c Release -r linux-x64 --no-self-contained --no-restore src/GrillBot.App/
CreateDockerImage:
runs-on: ubuntu-latest
needs: [ShouldDeploy, CheckStaticContent, BuildBot]
if: needs.ShouldDeploy.outputs.Bot == 'true' && github.ref == 'refs/heads/master'
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: src/
push: true
tags: ghcr.io/grillbot/grillbot:latest
build-args: |
github_actions_token=${{ secrets.GITHUB_TOKEN }}
Deployment_Production:
runs-on: ubuntu-latest
environment: Production
needs: CreateDockerImage
if: github.ref == 'refs/heads/master'
steps:
- name: Execute deployment on SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_Username }}
password: ${{ secrets.SSH_Password }}
port: 22
script: echo '${{ secrets.SSH_Password }}' | sudo -S /scripts/update-grillbot-prod.sh bot
VerifyProductionDeployment:
runs-on: ubuntu-latest
environment: ProductionInternal
needs: Deployment_Production
if: github.ref == 'refs/heads/master'
steps:
- name: Bot
uses: jtalk/url-health-check-action@v4
with:
url: https://health.grillbot.eu/bot
follow-redirect: true
max-attempts: 10
retry-delay: 5s