From 826ed1ce07696fd033797e81fe14e164ec997c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoni=20Nu=C3=B1ez=20Romeu?= Date: Fri, 27 Mar 2026 17:15:11 +0100 Subject: [PATCH] Fixes in deployments & ci/cd, readme info --- .gitea/workflows/deploy.yaml | 33 ++++++++--------- .github/workflows/node.js.yml | 23 +++++++++++- README.md | 67 ++++++++++++----------------------- 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index a600946..c5e94da 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,23 +1,24 @@ name: Deploy NPM app run-name: ${{ gitea.actor }} is deploying to PROD servers. -on: [push, fork, pull] +on: [ push, fork, pull ] jobs: Deploy NPM: runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: SSH to remote server - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - port: ${{ secrets.PORT }} - script: | - cd /home/zouklambadabcn.com/public_html/ - git pull - npm run build - pm2 restart ZLB - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + - name: Check out repository code + uses: actions/checkout@v4 + - name: SSH to remote server + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} + script: | + cd /home/zouklambadabcn.com/public_html/ + git pull + npm install + npm run build + pm2 restart ZLB + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9a22b67..90ad6e1 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -19,7 +19,6 @@ jobs: node-version: [18.x, 20.x, 22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - name: Test Summary uses: test-summary/action@v2 @@ -38,3 +37,25 @@ jobs: - run: npm ci - run: npm run build --if-present - run: npm test + - name: Output Build Status + uses: actions/github-script@v6 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { context } = require('@actions/github'); + const core = require('@actions/core'); + const fs = require('fs'); + const path = require('path'); + const readline = require('readline'); + + const outputPath = path.join(process.env.GITHUB_WORKSPACE, 'README.md'); + const fileStream = fs.createWriteStream(outputPath, { flags: 'a' }); + const rl = readline.createInterface({ input: process.stdin, output: fileStream }); + + if (context.isFailureGroup) { + core.setFailed('Build failed'); + } else { + rl.write('## Build Status\n'); + rl.write('![Build Status](https://github.com/{your_username}/{repository}/workflows/Node.js%20CI/badge.svg)\n'); + rl.close(); + } diff --git a/README.md b/README.md index 6b0fcbc..d476e24 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,25 @@ -Follow these steps: + +![Build Status](https://github.com/{your_username}/{repository_name}/workflows/{workflow_name}/badge.svg) + + +# Project Name + +ZoukLambadaBCN Beach Festival 2026 edition + +## Technologies Used + +- Vite +- TypeScript +- React +- shadcn-ui +- Tailwind CSS + +## Installation + +1. Clone the repository using the project's Git URL. +2. Navigate to the project directory. +3. Install the necessary dependencies. +4. Start the development server with auto-reloading and an instant preview. ```sh # Step 1: Clone the repository using the project's Git URL. @@ -12,47 +33,3 @@ npm i # Step 4: Start the development server with auto-reloading and an instant preview. npm run dev -``` - -**Edit a file directly in GitHub** - -- Navigate to the desired file(s). -- Click the "Edit" button (pencil icon) at the top right of the file view. -- Make your changes and commit the changes. - -**Use GitHub Codespaces** - -- Navigate to the main page of your repository. -- Click on the "Code" button (green button) near the top right. -- Select the "Codespaces" tab. -- Click on "New codespace" to launch a new Codespace environment. -- Edit files directly within the Codespace and commit and push your changes once you're done. - -## What technologies are used for this project? - -This project is built with: - -- Vite -- TypeScript -- React -- shadcn-ui -- Tailwind CSS - -## How can I deploy this project? -```sh -# Step 1: Clone the repository using the project's Git URL. -git clone - -# Step 2: Navigate to the project directory. -cd - -# Step 3: Install the necessary dependencies. -npm i - -# Step 4: Start the development server with auto-reloading and an instant preview. -npm run build - -npm install -g serve - -serve -s dist -```