From aa003c4affade48e1dd6466129cdd04b19426071 Mon Sep 17 00:00:00 2001 From: Shadi Date: Wed, 8 Apr 2026 21:25:43 +0200 Subject: [PATCH 1/2] Fix SearchBar component and add GitHub Actions workflow for deployment --- .github/workflows/deploy.yml | 46 +++++++++++++++++++++++++++++ task-1/src/components/SearchBar.tsx | 1 - 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..aa1da9b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy Weather Hero App + +on: + push: + branches: + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: task-1 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: task-1/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run linter + run: npm run lint + + - name: Run unit tests + run: npm run test + + - name: Build application + run: npm run build + + - name: Zip build output + run: zip -r dist.zip dist + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: weather-hero-dist + path: task-1/dist.zip diff --git a/task-1/src/components/SearchBar.tsx b/task-1/src/components/SearchBar.tsx index 6574666..6579f9b 100644 --- a/task-1/src/components/SearchBar.tsx +++ b/task-1/src/components/SearchBar.tsx @@ -7,7 +7,6 @@ interface Props { export function SearchBar({ onSearch, loading }: Props) { const [value, setValue] = useState(""); - const unusedConstMaybeDeleteMe = "Search"; const handleSubmit = (e: FormEvent) => { e.preventDefault(); From 5ece97eb07df62665ff2cc22fb2a0da974c6cdac Mon Sep 17 00:00:00 2001 From: Shadi Date: Wed, 8 Apr 2026 21:31:04 +0200 Subject: [PATCH 2/2] Add pull request trigger for deployment workflow --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aa1da9b..944b639 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: build-and-test: