-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
842de35
commit ab8ff44
Showing
1 changed file
with
131 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,136 @@ | ||
name: Docker Image CI | ||
run-name: Testing - Docker Image CI | ||
# name: Docker Image CI | ||
# run-name: Testing - Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
# on: | ||
# push: | ||
# branches: [ "main" ] | ||
# pull_request: | ||
# branches: [ "main" ] | ||
|
||
jobs: | ||
testFront: | ||
runs-on: ubuntu-latest | ||
# jobs: | ||
# testFront: | ||
# runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Metadata | ||
run: | | ||
echo "π The job was automatically triggered by a ${{ github.event_name }} event." | ||
echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }} (FRONTEND)." | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Check repo | ||
run: | | ||
echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | ||
echo "π₯οΈ The workflow is now ready to test your code on the runner." | ||
ls ${{ github.workspace }} | ||
- name: Install Node | ||
run: | | ||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash | ||
sudo apt-get install nodejs -y | ||
node -v | ||
echo "π Node has been installed." | ||
- name: Install Dependencies | ||
run: | | ||
cd ${{ github.workspace }}/NNotes | ||
npm install | ||
echo "π Frontend app dependencies have been installed" | ||
- name: Run Server | ||
env: | ||
PORT: 3000 | ||
DB_URI: "probando" | ||
MODE: "test" | ||
run: | | ||
cd ${{ github.workspace }}/NNotes | ||
nohup npx ts-node src/app.ts & | ||
echo "π Server is running on port $PORT" | ||
- name: Wait | ||
run: sleep 12 | ||
- name: Run Frontend Tests | ||
run: | | ||
cd ${{ github.workspace }}/NNotes | ||
npm run test | ||
- name: Git Semantic Version | ||
uses: PaulHatch/semantic-version@v4.0.3 | ||
with: | ||
major_pattern: "major:" | ||
minor_pattern: "feat:" | ||
format: "${major}.${minor}.${increment}" | ||
id: version | ||
- name: Docker Login | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
- name: Build Docker Image | ||
env: | ||
NEW_VERSION: ${{ steps.version.outputs.version }} | ||
run: | | ||
docker build -t delta27222/nnotes_frontend:$NEW_VERSION ./NNotes/ | ||
docker build -t delta27222/nnotes_frontend:latest ./NNotes/ | ||
- name: Push Docker Image | ||
env: | ||
NEW_VERSION: ${{ steps.version.outputs.version }} | ||
run: | | ||
docker push delta27222/nnotes_frontend:$NEW_VERSION | ||
docker push delta27222/nnotes_frontend:latest | ||
# steps: | ||
# - name: Metadata | ||
# run: | | ||
# echo "π The job was automatically triggered by a ${{ github.event_name }} event." | ||
# echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
# echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }} (FRONTEND)." | ||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
# - name: Check repo | ||
# run: | | ||
# echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | ||
# echo "π₯οΈ The workflow is now ready to test your code on the runner." | ||
# ls ${{ github.workspace }} | ||
# - name: Install Node | ||
# run: | | ||
# curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash | ||
# sudo apt-get install nodejs -y | ||
# node -v | ||
# echo "π Node has been installed." | ||
# - name: Install Dependencies | ||
# run: | | ||
# cd ${{ github.workspace }}/NNotes | ||
# npm install | ||
# echo "π Frontend app dependencies have been installed" | ||
# - name: Run Server | ||
# env: | ||
# PORT: 3000 | ||
# DB_URI: "probando" | ||
# MODE: "test" | ||
# run: | | ||
# cd ${{ github.workspace }}/NNotes | ||
# nohup npx ts-node src/app.ts & | ||
# echo "π Server is running on port $PORT" | ||
# - name: Wait | ||
# run: sleep 12 | ||
# - name: Run Frontend Tests | ||
# run: | | ||
# cd ${{ github.workspace }}/NNotes | ||
# npm run test | ||
# - name: Git Semantic Version | ||
# uses: PaulHatch/semantic-version@v4.0.3 | ||
# with: | ||
# major_pattern: "major:" | ||
# minor_pattern: "feat:" | ||
# format: "${major}.${minor}.${increment}" | ||
# id: version | ||
# - name: Docker Login | ||
# env: | ||
# DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
# run: | | ||
# docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
# - name: Build Docker Image | ||
# env: | ||
# NEW_VERSION: ${{ steps.version.outputs.version }} | ||
# run: | | ||
# docker build -t delta27222/nnotes_frontend:$NEW_VERSION ./NNotes/ | ||
# docker build -t delta27222/nnotes_frontend:latest ./NNotes/ | ||
# - name: Push Docker Image | ||
# env: | ||
# NEW_VERSION: ${{ steps.version.outputs.version }} | ||
# run: | | ||
# docker push delta27222/nnotes_frontend:$NEW_VERSION | ||
# docker push delta27222/nnotes_frontend:latest | ||
|
||
testBack: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Metadata | ||
run: | | ||
echo "π The job was automatically triggered by a ${{ github.event_name }} event." | ||
echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }} (BACKEND)." | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Check repo | ||
run: | | ||
echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | ||
echo "π₯οΈ The workflow is now ready to test your code on the runner." | ||
ls ${{ github.workspace }} | ||
- name: Install Node | ||
run: | | ||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash | ||
sudo apt-get install nodejs -y | ||
node -v | ||
echo "π Node has been installed." | ||
- name: Install Dependencies | ||
run: | | ||
cd ${{ github.workspace }}/NNotes-RestAPI | ||
npm install | ||
echo "π Backend app dependencies have been installed." | ||
- name: Run Tests | ||
run: | | ||
cd ${{ github.workspace }}/NNotes-RestAPI | ||
npm run test | ||
echo "π Backend tests have been executed." | ||
# Hasta aqui llega el test del frontend | ||
- name: Git Semantic Version | ||
uses: PaulHatch/semantic-version@v4.0.3 | ||
with: | ||
major_pattern: "major:" | ||
minor_pattern: "feat:" | ||
format: "${major}.${minor}.${increment}" | ||
id: version | ||
- name: Docker Login | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
- name: Build Docker Image | ||
env: | ||
NEW_VERSION: ${{ steps.version.outputs.version }} | ||
run: | | ||
docker build -t delta27222/nnotes_backend ./NNotes-RestAPI/ | ||
- name: Push Docker Image | ||
env: | ||
NEW_VERSION: ${{ steps.version.outputs.version }} | ||
run: | | ||
docker push delta27222/nnotes_backend | ||
# testBack: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Metadata | ||
# run: | | ||
# echo "π The job was automatically triggered by a ${{ github.event_name }} event." | ||
# echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
# echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }} (BACKEND)." | ||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
# - name: Check repo | ||
# run: | | ||
# echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | ||
# echo "π₯οΈ The workflow is now ready to test your code on the runner." | ||
# ls ${{ github.workspace }} | ||
# - name: Install Node | ||
# run: | | ||
# curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash | ||
# sudo apt-get install nodejs -y | ||
# node -v | ||
# echo "π Node has been installed." | ||
# - name: Install Dependencies | ||
# run: | | ||
# cd ${{ github.workspace }}/NNotes-RestAPI | ||
# npm install | ||
# echo "π Backend app dependencies have been installed." | ||
# - name: Run Tests | ||
# run: | | ||
# cd ${{ github.workspace }}/NNotes-RestAPI | ||
# npm run test | ||
# echo "π Backend tests have been executed." | ||
|
||
# # Hasta aqui llega el test del frontend | ||
# - name: Git Semantic Version | ||
# uses: PaulHatch/semantic-version@v4.0.3 | ||
# with: | ||
# major_pattern: "major:" | ||
# minor_pattern: "feat:" | ||
# format: "${major}.${minor}.${increment}" | ||
# id: version | ||
# - name: Docker Login | ||
# env: | ||
# DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
# run: | | ||
# docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
# - name: Build Docker Image | ||
# env: | ||
# NEW_VERSION: ${{ steps.version.outputs.version }} | ||
# run: | | ||
# docker build -t delta27222/nnotes_backend ./NNotes-RestAPI/ | ||
# - name: Push Docker Image | ||
# env: | ||
# NEW_VERSION: ${{ steps.version.outputs.version }} | ||
# run: | | ||
# docker push delta27222/nnotes_backend |