Merge pull request #5 from simanga-dev/fix-typo #26
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
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: Install dotnet-format | |
run: dotnet tool install -g dotnet-format | |
- name: Check format | |
run: dotnet format | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Docker Login | |
run: docker login --username ${{ secrets.USER_NAME }} --password ${{ secrets.PASSWORD }} ghcr.io | |
- name: Build | |
run: docker build . -t ghcr.io/simanga-dev/carpentry-shop:latest | |
- name: push | |
run: docker push ghcr.io/simanga-dev/carpentry-shop:latest |