Skip to content

Merge pull request #14 from DrNoLife/mediadisplay-rework-and-tag-incl… #28

Merge pull request #14 from DrNoLife/mediadisplay-rework-and-tag-incl…

Merge pull request #14 from DrNoLife/mediadisplay-rework-and-tag-incl… #28

Workflow file for this run

name: .NET Build and Deploy
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: Danbooru
- name: Build
run: dotnet build --no-restore
working-directory: Danbooru
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Test
run: dotnet test Danbooru.sln --verbosity detailed
working-directory: Danbooru
deploy:
needs: test
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./Danbooru # Or './Danbooru' if your Dockerfile is inside the Danbooru directory
file: ./Danbooru/Danbooru.UI/Danbooru.UI/Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/danbooruui:latest