backup-dell-laptop #72
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: Bog-API-Build | |
on: [push] | |
jobs: | |
build_nuget: | |
name: Build Application | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup-dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: setup-nuget | |
uses: nuget/setup-nuget@v1 | |
with: | |
nuget-version: 'latest' | |
- name: checkout-repo | |
uses: actions/checkout@v2 | |
with: | |
clean: 'true' | |
- name: echo-things | |
run: echo '${{github.workspace}} - ${{github.run_id}} - ${{github.run_number}}' | |
- name: setup-nuget-source | |
run: nuget sources add -Name "github" -Source "https://nuget.pkg.github.com/pirahawk/index.json" -username "pirahawk" -password "${{secrets.GITHUB_TOKEN}}" -StorePasswordInClearText -configfile ./nuget.config | |
- name: build-dotnet | |
run: dotnet build --nologo | |
- name: pack-nuget-packages-master | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: dotnet pack -o ./nugetPublish --nologo /p:version=1.0.${{github.run_number}} | |
- name: pack-nuget-packages-pre-release | |
if: github.event_name == 'push' && github.ref != 'refs/heads/master' | |
run: dotnet pack -o ./nugetPublish --nologo /p:version=1.0.${{github.run_number}}-alpha | |
- name: push-common-nuget-to-package-store | |
run: dotnet nuget push ./nugetPublish/*Common.[1-9]*.nupkg -s 'github' | |
- name: push-domain-nuget-to-package-store | |
run: dotnet nuget push ./nugetPublish/*Domain.[1-9]*.nupkg -s 'github' | |
- name: print-directory | |
run: ls -la ./nugetPublish | |
run_tests: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup-dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: checkout-repo | |
uses: actions/checkout@v2 | |
with: | |
clean: 'true' | |
- name: run-tests | |
run: dotnet test --nologo | |
build_docker: | |
name: Publish docker image | |
needs: [build_nuget, run_tests] | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout-repo | |
uses: actions/checkout@v2 | |
with: | |
clean: 'true' | |
# These do not currently work for me, commenting out till I understand them more | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v1 | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v1 | |
- name: docker-login | |
uses: docker/login-action@v1 | |
with: | |
registry: docker.pkg.github.com | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: docker-push | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: | | |
docker.pkg.github.com/${{ github.repository }}/bogapi:${{github.run_number}} | |
docker.pkg.github.com/${{ github.repository }}/bogapi:latest |