Serialize archived data to json #359
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: 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: | |
CheckStaticContent: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Markdown lint | |
uses: nosborn/[email protected] | |
with: | |
files: . | |
args: "README.md CONTRIBUTING.md SECURITY.md" | |
- 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@v4 | |
with: | |
python-version: 3.8 | |
- name: Crosscheck JSON content | |
run: python3 CI/check-texts.py | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
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 (DEBUG) | |
run: dotnet build -c Debug -r linux-x64 --no-self-contained --no-restore 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: [CheckStaticContent, Build] | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- 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 python3 /scripts/deploy/deploy.py prod/grillbot-app |