Merge pull request #246 from palladiumkenya/Dwapiv3122 #3
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 Deploy to main Latest tag | |
on: | |
push: | |
branches: | |
- DwapiBuildLatest | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '2.1.x' # Use the appropriate version for your project | |
- name: Install Node.js and npm | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.17.6' | |
- name: Install dependencies | |
run: npm install | |
working-directory: src/Dwapi | |
- name: Build the ASP.NET app | |
run: dotnet build src/Dwapi/Dwapi.csproj --configuration Release | |
- name: Build the angular UI | |
run: npm run build | |
working-directory: src/Dwapi | |
- name: Build the project | |
run: dotnet publish src/Dwapi/Dwapi.csproj -c Release -o ./publish | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# - name: Docker user Creds | |
# run: echo ${{secrets.DOCKER_USERNAME}} | sed 's/./& /g' | |
# - name: Docker pass Creds | |
# run: echo "${{secrets.DOCKER_PASSWORD}}" | sed 's/./& /g' | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: "${{secrets.DOCKER_PASSWORD}}" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: kenyahmis/dwapi:3.xLatest |