Skip to content

Commit

Permalink
Update ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharnitha authored Apr 1, 2024
1 parent 4ff2ba9 commit 2fede9c
Showing 1 changed file with 36 additions and 41 deletions.
77 changes: 36 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
# push:
# branches:
# - master

# jobs: jobname--> steps: - name: change directory working-directory: ./<foldername>, so in upcoming steps you don't need to switch directory.
jobs:
DotnetInstall:
name: Run dotnet on Ubuntu
Expand All @@ -19,50 +19,45 @@ jobs:
export PATH=$PATH:$HOME/dotnet
dotnet --version
# Install_dependencies:
# runs-on: ubuntu-latest
# needs: DotnetInstall
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Installing dependency
# run: dotnet restore
Install_dependencies:
runs-on: self-hosted
needs: DotnetInstall
steps:
- name: Installing dependency
run: dotnet restore

# Build_dotnet:
# runs-on: ubuntu-latest
# needs: Install_dependencies
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Installing dependency
# run: dotnet build --configuration Release
Build_dotnet:
runs-on: self-hosted
needs: Install_dependencies
steps:

- name: Installing dependency
run: dotnet build --configuration Release

# Publish_dotnet:
# runs-on: ubuntu-latest
# needs: Build_dotnet
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Installing dependency
# run: dotnet publish --configuration Release
Publish_dotnet:
runs-on: self-hosted
needs: Build_dotnet
steps:
- name: Installing dependency
run: dotnet publish --configuration Release

# - name: UploadArtifact
# uses: actions/upload-artifact@v4.3.1
# with:
# name: dotnetdll
# path: bin/Release/netcoreapp3.1/TodoApi.dll
- name: UploadArtifact
uses: actions/upload-artifact@v4.3.1
with:
name: dotnetdll
path: bin/Release/netcoreapp3.1/TodoApi.dll

# Build_image:
# runs-on: ubuntu-latest
# needs: Publish_dotnet
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Download Dll file
# run: gh run download ${{ github.run_id }}
# - name: Build Docker image
# run: |
# docker build -t demodotnet:${{ github.run_id }} .
Build_image:
runs-on: self-hosted
needs: Publish_dotnet
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Dll file
run: gh run download ${{ github.run_id }}
- name: Build Docker image
run: |
docker build -t demodotnet:${{ github.run_id }} .

0 comments on commit 2fede9c

Please sign in to comment.