Media display rework + tags on doom scroll #29
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: .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 |