feat: WebDav 和 Alist 的正式支持 #75
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: Push image on dev | |
on: | |
push: | |
branches: [dev] | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
strategy: | |
matrix: | |
configuration: [Release] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration $env:Configuration --no-restore | |
env: | |
Configuration: ${{ matrix.configuration }} | |
- name: Test | |
run: dotnet test --configuration $env:Configuration | |
env: | |
Configuration: ${{ matrix.configuration }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-debug | |
path: | | |
CSharp-OpenBMCLAPI/bin/Release | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
if: true | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set environment | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Log in to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: saltwood233/csharp-openbmclapi | |
- name: Build and push Docker image | |
id: push | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: saltwood233/csharp-openbmclapi:dev |