Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 35 additions & 0 deletions .github/workflows/a11y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Accessibility Checks

on:
pull_request:
branches:
- develop
- main

jobs:
accessibility:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run JSX Accessibility Lint
# run: pnpm eslint . --ext .js,.jsx,.ts,.tsx

- name: Build App
run: pnpm vite build
24 changes: 11 additions & 13 deletions .github/workflows/ci.yml → .github/workflows/develop-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: CI — Build & Push to Docker Hub
name: Frontend Develop Deployment

on:
push:
branches:
- copy
- develop

jobs:
build-and-push:
name: Build & Push
build-and-push-dev:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup pnpm
Expand All @@ -25,24 +24,23 @@ jobs:
node-version: 20
cache: pnpm

- name: Install dependencies
- name: Install Dependencies
run: pnpm install --frozen-lockfile

# - name: Build
# run: pnpm build:production

- name: Build
- name: Build App
run: pnpm vite build

- name: Log in to Docker Hub
- name: Login To Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
- name: Build And Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/stoneinscription:frontend-latest
tags: |
${{ secrets.DOCKER_USERNAME }}/stoneinscription-frontend:dev-latest
${{ secrets.DOCKER_USERNAME }}/stoneinscription-frontend:sha-${{ github.sha }}
38 changes: 38 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Frontend PR Validation

on:
pull_request:
branches:
- develop
- main

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Type Check
run: pnpm tsc --noEmit

- name: Build
run: pnpm vite build
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Frontend Release Pipeline

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build Production App
run: pnpm vite build

- name: Login To Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build And Push Release Images
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/stoneinscription-frontend:latest
${{ secrets.DOCKER_USERNAME }}/stoneinscription-frontend:${{ github.ref_name }}
${{ secrets.DOCKER_USERNAME }}/stoneinscription-frontend:sha-${{ github.sha }}
13 changes: 12 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@ import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import tseslint from 'typescript-eslint';
import { globalIgnores } from 'eslint/config';

export default tseslint.config([
globalIgnores(['dist']),

{
files: ['**/*.{ts,tsx}'],

extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
jsxA11y.flatConfigs.recommended,
],

languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},

rules: {
'jsx-a11y/alt-text': 'error',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/no-autofocus': 'warn',
},
},
]);
]);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react-swc": "^3.11.0",
"eslint": "^9.30.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
Expand Down
Loading
Loading