Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title is added for the pokedex list #260

Open
wants to merge 90 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
3ea92cd
eslint fix and yaml workflow added
Elijah-05 Nov 11, 2024
8aa1d81
Create hello.yml
Elijah-05 Nov 11, 2024
6bcefa6
Delete .github directory
Elijah-05 Nov 11, 2024
fe12bf0
Create hello.yml
Elijah-05 Nov 11, 2024
0a8c7c8
Update hello.yml
Elijah-05 Nov 11, 2024
e2f29e8
lint actions
Nov 13, 2024
57b4e3e
lint
Nov 13, 2024
9a36f9d
fix the eslint issue
Nov 13, 2024
e79ff2e
fix the eslint issue again
Nov 13, 2024
82c7e2a
fix the eslint issue again
Nov 13, 2024
4862a8f
fix the eslint issue again
Nov 13, 2024
589c7b1
fix the eslint issue again last
Nov 13, 2024
fbd7c41
build and test command steps are added on workflow
Nov 13, 2024
4173333
fix test
Nov 13, 2024
2e56d56
playwright e2e test
Nov 13, 2024
c7c8665
fix: test of e2e try to fix
Nov 13, 2024
5dfa69b
e2e tests are fixed
Nov 13, 2024
b29d352
fix: e2e test is fixed again for the last time
Nov 13, 2024
d4c9f74
e2e test for navigating page
Nov 13, 2024
9111fe5
prepare for render deploy in production
Nov 13, 2024
2221bef
trigger render deployment and created secrete for serviceId and apiKey
Nov 14, 2024
d4c9104
package script configured for build command
Nov 14, 2024
0c479f5
check the version number changed/incremented
Nov 14, 2024
5402ff0
health check service added on app file
Nov 14, 2024
7e8b925
health check service throws an error to test pipeline
Nov 14, 2024
6021616
playwright end to end test config file update to test form the build …
Nov 14, 2024
4c379bc
health route file is returned back to the correct and working
Nov 14, 2024
5c7771a
health check service throws an error to test pipeline
Nov 14, 2024
c1a0887
health route file is returned back to the correct and working
Nov 14, 2024
ce38751
workflows update for a pull request trigger command
Nov 14, 2024
8490093
pokedex title change for checking the workflows trigger
Nov 14, 2024
16cbb2a
Merge pull request #1 from Elijah-05/featured-branch
Elijah-05 Nov 14, 2024
d48ddb6
deployment context- deployment step triggered only if the event is pu…
Nov 14, 2024
b2d73de
Merge pull request #2 from Elijah-05/featured-branch
Elijah-05 Nov 14, 2024
e5a286c
change title color and version
Nov 14, 2024
1d8fd4c
change title color and version and deployment trigger for all event
Nov 14, 2024
215ebe9
change title color and version and deployment trigger for all event
Nov 14, 2024
5bac3e5
Merge pull request #3 from Elijah-05/featured-branch
Elijah-05 Nov 14, 2024
3b36f88
brand new title and desc
Nov 14, 2024
b2ac5d2
Merge pull request #4 from Elijah-05/featured-branch
Elijah-05 Nov 14, 2024
a65efb9
bump version comman on workflows
Nov 15, 2024
b6e8477
Merge pull request #5 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
5b4cf30
title, version and conditions are created for deploymnet
Nov 15, 2024
af0d775
Merge pull request #6 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
7d8458d
tag release job created on a separate job and it needs the test and t…
Nov 15, 2024
b91769c
tag release job created on a separate job and it needs the test and t…
Nov 15, 2024
9c6229e
Merge pull request #7 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
6667855
tag release job created on a separate job and it needs the test and t…
Nov 15, 2024
a068f4a
Merge pull request #8 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
6d6c349
checkout step added in tag_release job
Nov 15, 2024
1aec17a
Merge pull request #9 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
279dfd4
github context for commit message to skip deployment
Nov 15, 2024
7d9d229
Merge pull request #10 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
3d949a7
title styles are updated #skip
Nov 15, 2024
2834e01
Merge pull request #11 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
601c2f7
condition and message variable on global
Nov 15, 2024
e3cd5a9
condition and message variable on global
Nov 15, 2024
b353b3f
Merge pull request #12 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
58d6ebe
condition and message variable on global #ski
Nov 15, 2024
0275a16
Merge pull request #13 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
a2d0bcb
still checking the env variables
Nov 15, 2024
95c4939
env value test
Nov 15, 2024
76d5984
skip message test
Nov 15, 2024
5c6e070
skip message test #skip
Nov 15, 2024
8dbd901
skip message test #skip command
Nov 15, 2024
50c40c4
skip message test command
Nov 15, 2024
1820b9a
#skiop message test command
Nov 15, 2024
9c718b7
condition is fixed and #skiip
Nov 15, 2024
18ffe4b
title content and color changed and #skip this for deployment
Nov 15, 2024
bf5a4d3
title content and color changed and this for deployment
Nov 15, 2024
ae3a724
pokedex list title update
Nov 15, 2024
1dcc675
title content and color update
Nov 15, 2024
9642fef
broken pink border around list container
Nov 15, 2024
40ccaa1
broken pink border around list container
Nov 15, 2024
5f2c59f
container style update
Nov 15, 2024
ba2df32
container background and padding style
Nov 15, 2024
0d32e3d
Merge pull request #16 from Elijah-05/featured-branch
Elijah-05 Nov 15, 2024
ec69585
discord notification template step is added in workflows job
Nov 16, 2024
f97c314
Merge branch 'main' into featured-branch
Elijah-05 Nov 16, 2024
e2177cd
discord notification template step is added in workflows job
Nov 16, 2024
7f03c1b
version changed to 7 and webhook url added to github secret
Nov 16, 2024
03c371d
merge to the latest
Nov 16, 2024
87183ea
list container margin and background is removed
Nov 16, 2024
c8dcb3a
Merge pull request #17 from Elijah-05/featured-branch
Elijah-05 Nov 16, 2024
6773499
periodic health check
Nov 16, 2024
2318649
Merge branch 'main' into featured-branch
Elijah-05 Nov 16, 2024
dfe1432
Merge pull request #18 from Elijah-05/featured-branch
Elijah-05 Nov 16, 2024
060d4b3
schedule health check every 5min to test
Elijah-05 Nov 17, 2024
7642ebb
Merge branch 'main' into featured-branch
Elijah-05 Nov 17, 2024
8d1f595
Update deployment.yml
Elijah-05 Nov 17, 2024
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT = 3000
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
webpack.config.js
node_modules/
dist/
.eslintrc.js
35 changes: 35 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
root: true,
env: {
browser: true,
es2020: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended", // Ensures React-specific linting
// "plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs", "test"],
parserOptions: {
ecmaVersion: 2020, // Enables modern JavaScript features
sourceType: "module", // Specifies ES6 modules
ecmaFeatures: {
jsx: true, // Enables JSX parsing for React
},
},
plugins: ["react", "react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
indent: ["error", 2],
"linebreak-style": 0,
eqeqeq: "error",
"no-trailing-spaces": "error",
"object-curly-spacing": ["error", "always"],
"arrow-spacing": ["error", { before: true, after: true }],
"no-console": 0,
},
};
49 changes: 0 additions & 49 deletions .eslintrc.js

This file was deleted.

136 changes: 136 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Deployment pipeline

env:
# Check if any commit message includes '#skip'
IS_SKIP_COMMIT: ${{ contains(join(github.event.commits.*.message, ' '), '#skip') }}

on:
push:
branches:
- main
pull_request:
branches: [main]
types: [opened, synchronize]
schedule:
- cron: "0 0 * * *"

jobs:
hello_world_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello World!"
- name: Now it is
run: |
date
- name: Directory content
run: |
ls -l
simple_deployment_pipeline:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: lint
run: npm run eslint
- name: build
run: npm run build
- name: test
run: npm run test
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Trigger deployment
if: ${{ github.event_name == 'push' && env.IS_SKIP_COMMIT == 'false' }}
uses: sws2apps/render-deployment@main #consider using pin for dependabot auto update
with:
serviceId: ${{ secrets.RENDER_SERVICE_ID }}
apiKey: ${{ secrets.RENDER_API_KEY }}
multipleDeployment: false #optional, default true

- name: Test Success
uses: rjstone/discord-webhook-notify@v1
if: success()
with:
severity: info
details: Test Succeeded!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Test Failure
uses: rjstone/discord-webhook-notify@v1
if: failure()
with:
severity: error
details: Test Failed!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Test Cancelled
uses: rjstone/discord-webhook-notify@v1
if: cancelled()
with:
severity: warn
details: Test Cancelled!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

tag_release:
needs: [simple_deployment_pipeline]
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Bump version and push tag
if: ${{ github.event_name == 'push' && env.IS_SKIP_COMMIT == 'false' }}
uses: anothrNick/github-tag-action@1.71.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

periodic_health_check:
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' }}
steps:
- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v4
with:
url: https://full-stack-open-pokedex-full.onrender.com/|https://full-stack-open-pokedex-full.onrender.com/version|https://full-stack-open-pokedex-full.onrender.com/health
follow-redirect: false
max-attempts: 3
retry-delay: 5s
retry-all: false
- name: Notify on Health Check Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1
with:
severity: error
details: Health Check Failed! Please investigate the service.
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
# runs-on: ubuntu-20.04
# steps:
# - name: Check the deployed service URL
# uses: jtalk/url-health-check-action@v4
# with:
# # Check the following URLs one by one sequentially
# url: https://full-stack-open-pokedex-full.onrender.com/|https://full-stack-open-pokedex-full.onrender.com/version|https://full-stack-open-pokedex-full.onrender.com/health
# # Follow redirects, or just report success on 3xx status codes
# follow-redirect: false # Optional, defaults to "false"
# # Fail this action after this many failed attempts
# max-attempts: 3 # Optional, defaults to 1
# # Delay between retries
# retry-delay: 5s # Optional, only applicable to max-attempts > 1
# # Retry all errors, including 404. This option might trigger curl upgrade.
# retry-all: false # Optional, defaults to "false"
# # String representation of cookie attached to health check request.
# # Format: `Name=Value`
# cookie: "token=asdf1234" # Optional, default is empty
# # Basic auth login password pair.
# # Format: `login:password`
# basic-auth: "login:password" # Optional, default is empty
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
dist/
node_modules/
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
13 changes: 12 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
const express = require("express");
const app = express();
require("dotenv").config();

// get the port from env variable
const PORT = process.env.PORT || 5000;
const PORT = process.env.PORT || 3000;

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

app.get("/version", (req, res) => {
res.send("7"); // change this string to ensure a new version deployed
});

app.get("/health", (req, res) => {
// eslint-disable-next-line no-constant-condition
// if (true) throw "error... ";
res.send("ok");
});

app.listen(PORT, () => {
console.log(`server started on port ${PORT}`);
});
5 changes: 5 additions & 0 deletions build_step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "Build script"

# add the commands here
Loading