Move back to default location #7
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: Build and Package | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
# Execute all unit tests in the solution | |
- name: Execute unit tests | |
working-directory: ./UniversalNFT.dev.API.Tests | |
run: dotnet test | |
# setup Docker buld action | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Github Packages | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Build image and push to Docker Hub and GitHub Container Registry | |
uses: docker/build-push-action@v2 | |
with: | |
# relative path to the place where source code with Dockerfile is located | |
context: ./UniversalNFT.dev.API | |
# Note: tags has to be all lower-case | |
tags: | | |
ghcr.io/ohonesix/universalnftdev:latest | |
# build on feature branches, push only on main branch | |
push: ${{ github.ref == 'refs/heads/main' }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |