Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
42f5d3c
feat: add first workflow
William-nyarash May 20, 2026
dfdf895
feat: print date and list the directory content
William-nyarash May 20, 2026
c88fedf
feat: new workflow
William-nyarash May 20, 2026
6ffdc33
modify file
William-nyarash May 20, 2026
7891b2e
fix: yaml syntax
William-nyarash May 20, 2026
5e915e6
fix: yaml syntax
William-nyarash May 20, 2026
67c459b
fix: yaml syntax
William-nyarash May 20, 2026
63fd1ed
fix: typo
William-nyarash May 20, 2026
8052cf9
fix: linting error
William-nyarash May 20, 2026
0abad7d
feature: add build and test steps
William-nyarash May 20, 2026
723621c
fix: solve the failing test
William-nyarash May 20, 2026
c508035
feat: add e2e test
William-nyarash May 22, 2026
1833540
feat: add playwright , update workflow
William-nyarash May 22, 2026
e83f924
fix: disable eslint console warning
William-nyarash May 22, 2026
265b61d
fix: update test
William-nyarash May 22, 2026
67fcc2c
feat: disable lint warning
William-nyarash May 22, 2026
3da8e27
modify
William-nyarash May 22, 2026
b99cc71
fix: playwright script
William-nyarash May 22, 2026
1b25227
fix: add worklow to install playwright dependancies
William-nyarash May 22, 2026
5fbceca
fix: add worklow to install playwright dependancies
William-nyarash May 22, 2026
367f47a
fix: missing dependancies
William-nyarash May 22, 2026
f25d2fd
fix: missing dependancies
William-nyarash May 22, 2026
94d0057
modify
William-nyarash May 22, 2026
1572f57
fix: update config for server to start before e2e test
William-nyarash May 22, 2026
390c2c7
fix: update config for server to start before e2e test
William-nyarash May 22, 2026
283229b
fix: update port
William-nyarash May 22, 2026
16b5626
feat: add more test
William-nyarash May 22, 2026
47be3f4
fix: conflictd
William-nyarash May 24, 2026
39c0009
update: add live link
William-nyarash May 24, 2026
334d80c
fix
William-nyarash May 24, 2026
c45b880
Fix link formatting in README
William-nyarash May 24, 2026
3030322
feat: add healthcheck
William-nyarash May 24, 2026
046cbe4
Revert "fix"
William-nyarash May 24, 2026
468d5e6
check the health
William-nyarash May 24, 2026
ec99822
fix: remove the deployment test
William-nyarash May 24, 2026
1004d2b
feat: pull request trigger
William-nyarash May 24, 2026
01d0cb3
feat: guardrail for deployment
William-nyarash May 24, 2026
16c89d7
feat: configure versioning step
William-nyarash May 24, 2026
31507fd
feat: configure seperate job
William-nyarash May 24, 2026
8e60489
Merge pull request #1 from William-nyarash/pull-request
William-nyarash May 24, 2026
526a40b
fix
William-nyarash May 24, 2026
e70a7a8
fix workflow
William-nyarash May 24, 2026
a1daa87
fix workflow
William-nyarash May 24, 2026
f898db7
fix workflow
William-nyarash May 24, 2026
3f1685b
fix
William-nyarash May 24, 2026
78fa303
fix: replace the bump variable
William-nyarash May 24, 2026
d4a886f
test: github message
William-nyarash May 24, 2026
f7990aa
update: deployment and versioning
William-nyarash May 24, 2026
f914bcd
update: deployment and versioning
William-nyarash May 24, 2026
7b2b465
update: deployment and versioning
William-nyarash May 24, 2026
470bd05
fix
William-nyarash May 25, 2026
83f73e0
fix
William-nyarash May 25, 2026
0a3bbb2
feat: add webhook
William-nyarash May 25, 2026
c1bae75
feat: add webhook
William-nyarash May 25, 2026
31289a6
fix: fix typo
William-nyarash May 25, 2026
1f2463a
feat: seperate the logical jobs
William-nyarash Jun 3, 2026
4e37c8d
feat: create workflow
William-nyarash Jun 4, 2026
9c316db
fix
William-nyarash Jun 4, 2026
e806d22
fix: indentation
William-nyarash Jun 4, 2026
666dcfa
fix: rename workflow
William-nyarash Jun 5, 2026
1ff9292
add space
William-nyarash Jun 5, 2026
e19be6d
fix indentation on the workflow
William-nyarash Jun 5, 2026
68ba369
fix indentation on the workflow
William-nyarash Jun 5, 2026
c4f29b5
fix indentation on the workflow
William-nyarash Jun 5, 2026
0390a85
feat: update the workflow
William-nyarash Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/github-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Testing github workflow

on:
push:
branches:
- main

jobs:
a_test_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: github context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: commits
env:
COMMITS: ${{ toJson(github.event.commits) }}
run: echo "$COMMITS"
- name: commit messages
env:
COMMIT_MESSAGES: ${{ toJson(github.event.commits.*.message) }}
run: echo "$COMMIT_MESSAGES"
19 changes: 19 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Hello world!

on:
push:
branches:
- main
jobs:
hello-world-job:
runs-on: ubuntu-latest
steps:
- name: say hello world!
run: |
echo "Hello World!"
- name: print current date
run: date


- name: list the directory
run: ls -l
18 changes: 18 additions & 0 deletions .github/workflows/period.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Periodic Hello

on:
workflow_dispatch:
schedule:
- cron: '*/15 * * * *'

jobs:
health_check:
runs-on: ubuntu-latest

steps:
- name: Check if the deployed app is healthy
uses: jtalk/url-health-check-action@v5
with:
url: https://pokemon-ci-cd.onrender.com/health
max-attempts: 3
retry-delay: 3s
116 changes: 116 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Deployment pipeline

on:
push:
branches:
- main

pull_request:
branches: [ main ]
types: [ opened, synchronize ]

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: install the dependancies
run: npm install

- name: Check style
run: npm run eslint

- name: Run Test
run: npm test

- name: Build step
run: npm run build

- name: Install playwright drivers
run: |
npx playwright install
sudo npx playwright install-deps

- name: end-to-end test
run: npm run test:e2e

deploy:
needs: build_and_test

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: install the dependancies
run: npm install
- name: Trigger deployment
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip') }}
run: curl ${{ secrets.RENDER_DEPLOY_HOOK }}

tag_release:
needs: [ build_and_test, deploy ]

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: install the dependancies
run: npm install

- name: Bump version and push tag
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip') }}
uses: anothrNick/github-tag-action@1.75.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: minor

notificatfy_success:
needs: [build_and_test, deploy ]

runs-on: ubuntu-latest

steps:
- name: Send notification to discord
uses: sarisia/actions-status-discord@v1
if: ${{ always() && github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip') }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
# content: "Hello <@&${{ secrets.DISCORD_ROLE_ID }}>"
title: "Deployment"
description: |
Build and deploy to Github Pages
image: ${{ secrets.EMBED_IMAGE }}
color: ${{ job.status == 'success' && 'green' || job.status == 'failure' && 'red' || 'yellow' }}

notify_failure:
needs: [build_and_test,deploy ]

runs-on: ubuntu-latest

steps:
- name: Send error notification
uses: sarisia/actions-status-discord@v1
if: ${{ failure() && github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip') }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
content: "Hello <@&${{ secrets.DISCORD_ID }}>"
title: "Deployment"
description: |
Build and deploy to Github Pages
image: ${{ secrets.EMBED_IMAGE }}
color: ${{ job.status == 'success' && 'green' || job.status == 'failure' && 'red' || 'yellow' }}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
dist/
node_modules/
node_modules/

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Full Stack open CI/CD

This repository is used for the CI/CD module of the Full Stack Open course
> [!Notice]
> This repository is used for the CI/CD module of the Full Stack Open course

## Commands

Expand All @@ -11,3 +12,9 @@ Start by running `npm install` inside the project folder
`npm run eslint` to run eslint
`npm run build` to make a production build
`npm run start-prod` to run your production build

## deployed app

The app is deployed on render

visit [here](https://pokemon-ci-cd.onrender.com)
15 changes: 9 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const express = require("express");
const app = express();

const express = require('express')
const app = express()
// get the port from env variable
const PORT = process.env.PORT || 5001;
const PORT = process.env.PORT || 5001

app.use(express.static('dist'))
app.get('/health', (req,res) => {
res.status(200).json({ status: 'ok' })
})

app.use(express.static("dist"));

const start = async () => {
await app.listen(PORT)
app.listen(PORT)
console.log(`server started on port ${PORT}`)
}

Expand Down
26 changes: 26 additions & 0 deletions e2e-tests/Pokemon.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// @ts-check
import { test, expect } from '@playwright/test'
import { describe } from 'node:test'

describe('Pokedex', () => {
test('front page can be opened', async ({ page }) => {
await page.goto('http://localhost:8080/')

await expect(page.getByText('ivysaur')).toBeVisible()

await expect(
page.getByText(
'Pokémon and Pokémon character names are trademarks of Nintendo.'
)
).toBeVisible()
})
test('expect a pokemon description to be visible', async ({ page })=>
{
await page.goto('http://localhost:8080/pokemon/ivysaur')
await expect(
page.getByText(
'chlorophyll'
)
).toBeVisible()
})
})
3 changes: 2 additions & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { TextEncoder, TextDecoder } = require('util')
/* eslint-disable no-undef */
import { TextEncoder, TextDecoder } from 'util'

global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
79 changes: 72 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading