From 6dfd8275e2bc6860d15224ba2c5438d67006581d Mon Sep 17 00:00:00 2001 From: MaryKilewe Date: Thu, 14 Nov 2024 10:20:51 +0000 Subject: [PATCH] Create build-dwapi-3.xlatest.yml --- .github/workflows/build-dwapi-3.xlatest.yml | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build-dwapi-3.xlatest.yml diff --git a/.github/workflows/build-dwapi-3.xlatest.yml b/.github/workflows/build-dwapi-3.xlatest.yml new file mode 100644 index 00000000..2e011234 --- /dev/null +++ b/.github/workflows/build-dwapi-3.xlatest.yml @@ -0,0 +1,60 @@ +name: Build and Deploy to 3.xLatest + +on: + push: + branches: + - dev + +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