v0.4.1 #10
Workflow file for this run
This file contains hidden or 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: Publish Release Version | |
| permissions: | |
| contents: write | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-release-artifacts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Restore NuGet packages | |
| run: dotnet restore | |
| - name: Publish | |
| run: dotnet publish --configuration Release --artifacts-path ./artifacts | |
| - name: Upload build artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: ./artifacts/publish/**/* | |
| - name: Upload release artifacts | |
| if: github.event_name == 'release' | |
| run: | | |
| zip -r ./artifacts/KnowledgeBaseServer.zip ./artifacts/publish/KnowledgeBaseServer/release | |
| gh release upload ${{ github.event.release.tag_name }} ./artifacts/KnowledgeBaseServer.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-container-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: mbcrawfo/knowledge-base-server | |
| tags: type=semver,pattern={{version}} | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Clone the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: src/KnowledgeBaseServer/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |