Adds CI/CD pipeline for portfolio deployment
All checks were successful
Deploy React portfolio / deploy (push) Successful in 31s

Sets up a CI/CD pipeline to automate the deployment of the portfolio website to a web server.

The pipeline includes steps for:
- Checking out the code
- Setting up Node.js
- Installing dependencies
- Building the application
- Deploying the built application to the web server via SSH.

This automated deployment ensures that the portfolio is always up-to-date with the latest changes.

feat: update to use correct ssh

Updates deployment script to use dist folder

Modifies the deployment script to correctly reference the `dist` directory instead of the `build` directory.

This ensures that the correct files are deployed to the web server.

Automates deployment workflow using Gitea Actions

Sets up a Gitea Actions workflow to automatically build and deploy the React portfolio website to the production server.

This includes:
- Using a containerized environment for consistent builds.
- Installing dependencies and building the project.
- Deploying the built files to the web server via SSH and rsync.
- Reloading the web server configuration to apply changes.

Also, this change updates the .gitignore file to exclude the 'dist' directory.

edit to use ssh secret instead

fix: english translation for education

fix: correct contact mail

fix: store system choice for theme
This commit is contained in:
Louis
2025-10-29 01:19:27 +01:00
parent e91f55b80d
commit a55a7fd58a
5 changed files with 53 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
name: Deploy React portfolio
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
- name: Deploy to server
run: |
tar czf portfolio.tar.gz -C dist .
scp -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new portfolio.tar.gz ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/tmp/
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "\
sudo rm -rf ${{ secrets.DEPLOY_PATH }}/* && \
sudo tar xzf /tmp/portfolio.tar.gz -C ${{ secrets.DEPLOY_PATH }}/ && \
sudo rm /tmp/portfolio.tar.gz && \
sudo chown -R deploy:www-data ${{ secrets.DEPLOY_PATH }} && \
sudo chmod -R 775 ${{ secrets.DEPLOY_PATH }} && \
sudo systemctl reload nginx"

3
.gitignore vendored
View File

@@ -86,3 +86,6 @@ typings/
# DynamoDB Local files # DynamoDB Local files
.dynamodb/ .dynamodb/
# Vite react build output
dist/

View File

@@ -37,6 +37,7 @@ function App() {
}; };
handleChange(); handleChange();
localStorage.setItem('themeSelected', themeSelected);
mediaQuery.addEventListener('change', handleChange); mediaQuery.addEventListener('change', handleChange);
return () => mediaQuery.removeEventListener('change', handleChange); return () => mediaQuery.removeEventListener('change', handleChange);

View File

@@ -12,7 +12,7 @@ const Contact = () => {
</p> </p>
<div className="flex flex-col md:flex-row gap-4 justify-center items-center"> <div className="flex flex-col md:flex-row gap-4 justify-center items-center">
<a <a
href="mailto:louis.emard@example.com" href="mailto:emard.louis@icloud.com"
className="px-8 py-3 bg-accent text-white rounded-lg hover:bg-accent/90 transition-all hover:shadow-lg w-full md:w-auto" className="px-8 py-3 bg-accent text-white rounded-lg hover:bg-accent/90 transition-all hover:shadow-lg w-full md:w-auto"
> >
📧 {t('contact.email')} 📧 {t('contact.email')}

View File

@@ -1,13 +1,13 @@
{ {
"title": "Education", "title": "Education",
"degree1": { "degree1": {
"title": "Bachelor's Degree in Computer Science", "title": "Engineering Degree in Computer Science",
"school": "University Name", "school": "CNAM Angoulême",
"description": "Specialized in software engineering and web development" "description": "Specialization in digital media science and technologies"
}, },
"degree2": { "degree2": {
"title": "Technical Diploma", "title": "Bachelor's Degree in Computer Science",
"school": "Technical Institute", "school": "University of La Rochelle",
"description": "Foundation in computer science and programming" "description": "Foundation in computer science and programming"
} }
} }