Skip to content

Commit

Permalink
Implement workflow for joke cracker on github actions repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Pats101 committed Sep 26, 2024
1 parent 454f4b8 commit 93fed16
Show file tree
Hide file tree
Showing 10 changed files with 1,771 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jquery-3.5.1.js
node_modules/
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true,
"jquery": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}
42 changes: 42 additions & 0 deletions .github/workflows/deploy-joke-cracker-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This GitHub Actions workflow automates the deployment process for the Inspiring Quote Generator application.
# It is triggered on push events to the main branch and includes the following steps:
# 1. Checkout the repository.
# 2. Set up the Node.js environment.
# 3. Install dependencies using npm.
# 4. Run tests to ensure code quality.
# 5. Build the application.
# 6. Deploy the application to the specified hosting service.
name: Deploy Joke Cracker Generator

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Run Gitleaks to detect sensitive data
uses: zricethezav/gitleaks-action@v1.2.0
with:
config_path: .gitleaks.toml
args: "--path . --verbose"

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Build project
run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 4 additions & 0 deletions _headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
5 changes: 5 additions & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Redirect /old-page to /new-page
/old-page /new-page 301

# For SPAs, redirect all 404s to the index.html
/* /index.html 200
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{files: ["**/*.{js,mjs,cjs,ts}"]},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
Loading

0 comments on commit 93fed16

Please sign in to comment.