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
119 changes: 119 additions & 0 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Build & Publish Web App

on:
workflow_dispatch:

permissions:
contents: write

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
check-branch:
name: Validate Branch
runs-on: ubuntu-latest
steps:
- name: Assert development branch
run: |
echo "Triggered branch: ${{ github.ref_name }}"
if [ "${{ github.ref_name }}" != "development" ]; then
echo "Error: This workflow can only be manually run on the 'development' branch."
exit 1
fi

build-web:
name: Build Web App
needs: check-branch
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
token: ${{ secrets.PA_TOKEN }}
fetch-depth: 0

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

- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: yarn install --immutable

- name: Build Web App
run: yarn build
env:
REACT_APP_GOOGLE_CLIENT_ID: ${{ secrets.REACT_APP_GOOGLE_CLIENT_ID }}

- name: Upload Web Build Artifacts
uses: actions/upload-artifact@v7
with:
name: web-build-frontend
path: build/
retention-days: 1

release-web:
name: Release Web App
needs: build-web
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
token: ${{ secrets.PA_TOKEN }}
fetch-depth: 0

- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@latest
with:
github-token: ${{ secrets.PA_TOKEN }}
git-user-name: 'GrowBoard Bot'
output-file: false
version-file: 'package.json'
git-path: '.'
tag-prefix: 'v'
skip-on-empty: 'false'

- name: Download Web Build Artifacts
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: actions/download-artifact@v7
with:
name: web-build-frontend
path: build/

- name: Zip Build Artifacts
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
cd build
zip -r ../web-build.zip .
cd ..

- name: Create GitHub Release
uses: softprops/action-gh-release@v4
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
files: web-build.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }}

- name: 📂 Sync files
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.MAC_AMITRAIKWAR_FTP_SERVER }}
username: ${{ secrets.MAC_AMITRAIKWAR_FTP_ACCOUNT }}
password: ${{ secrets.MAC_AMITRAIKWAR_FTP_PASSWORD }}
local-dir: build/
server-dir: ./
52 changes: 52 additions & 0 deletions .github/workflows/ci-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Web CI

on:
push:
branches:
- development
paths:
- 'src/**'
- 'public/**'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/ci-web.yml'
pull_request:
branches:
- development
paths:
- 'src/**'
- 'public/**'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/ci-web.yml'

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
web-ci:
name: Lint, Build and Test Web
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6

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

- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: yarn install --immutable

- name: Lint
run: yarn lint

- name: Build
run: yarn build

- name: Test
run: yarn test --watchAll=false --passWithNoTests
28 changes: 0 additions & 28 deletions .github/workflows/deploy.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/main.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/release.yml

This file was deleted.

12 changes: 11 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
approvedGitRepositories:
- "**"
- '**'

cacheFolder: ./node_modules/.yarn/cache

enableScripts: true

installStatePath: ./node_modules/.yarn/install-state.gz

nodeLinker: node-modules

npmMinimalAgeGate: 0

patchFolder: ./node_modules/.yarn/patches

pnpUnpluggedFolder: ./node_modules/.yarn/unplugged

virtualFolder: ./node_modules/.yarn/__virtual__
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module.exports = {
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
moduleDirectories: ['node_modules'],
moduleNameMapper: {
'@assets': '<rootDir>/src/assets',
'@assets/*': '<rootDir>/src/assets/*',
'^@assets$': '<rootDir>/src/assets',
'^@assets/(.*)$': '<rootDir>/src/assets/$1',
'@router': '<rootDir>/src/router',
'@screens': '<rootDir>/src/screens',
'@hooks': '<rootDir>/src/hooks',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"react-test-renderer": "^18.3.0",
"ts-jest": "^29.1.2"
},
"packageManager": "yarn@4.17.0",
"repository": "git@github.com:AmitRaikwar-in/MacMock.git",
"author": "Amit Raikwar",
"license": "MIT"
Expand Down
Loading