Skip to content

Commit

Permalink
Refactor GitHub Actions workflow for frontend deployment and update p…
Browse files Browse the repository at this point in the history
…ackage.json for CI
  • Loading branch information
bluescorpian committed Feb 5, 2025
1 parent 31c972e commit 62c07c8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Deploy frontend to Pages
name: Deploy Frontend to Pages

on:
push:
branches: ["main"]
branches:
- main
pull_request:
branches: ["main"]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: client
working-directory: frontend

steps:
- uses: actions/checkout@v4
- name: Use Node.js
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: npm run build
working-directory: frontend

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: "frontend/dist"
# Upload the build output from the "dist" folder
path: dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json"
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
"ci": "npm install"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^5.0.3",
Expand Down

0 comments on commit 62c07c8

Please sign in to comment.