added linux #31
This file contains hidden or 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: Multiple Jobs Lab | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| # First job: Build | |
| build: | |
| name: Build Application | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build step | |
| run: | | |
| echo "🏗️ Building the application..." | |
| echo "Build completed successfully!" | |
| # Second job: Test | |
| test: | |
| name: Run Tests | |
| needs: build # Depends on build job | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Run tests | |
| run: | | |
| echo "🧪 Running tests..." | |
| echo "All tests passed!" | |
| # Third job: Deploy | |
| deploy: | |
| name: Deploy Application | |
| needs: [build, test] # Depends on both build and test jobs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy | |
| run: | | |
| echo "🚀 Deploying application..." | |
| echo "Deployment successful!" | |
| # Fourth job: Notify | |
| notify: | |
| name: Send Notification | |
| needs: deploy # Depends on deploy job | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send notification | |
| run: | | |
| echo "📧 Sending deployment notification..." | |
| echo "Notification sent!" |