Test CICD. #1
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: Continuous Integration | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Run tests | |
run: npm test | |
- name: Send email notification if build fail | |
if: failure() | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp.gmail.com | |
server_port: 587 | |
username: ${{ secrets.EMAIL_USERNAME }} | |
password: ${{ secrets.EMAIL_PASSWORD }} | |
subject: GitHub Actions - Build Failure | |
body: | | |
The recent build has failed. | |
- Repository: ${{ github.repository }} | |
- Workflow: ${{ github.workflow }} | |
- PR Link: ${{ github.event.pull_request.html_url }} | |
Please check the details in the GitHub Actions logs. | |
to: aimsalam.com@gmail.com | |
from: CI Bot <ci-bot@example.com> |