generated from Arquisoft/dede_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from Arquisoft/Despliegue
Despliegue
- Loading branch information
Showing
17 changed files
with
230 additions
and
136 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
name: CI for ASW2122 | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
docker-push-webapp: | ||
name: Push webapp Docker Image to GitHub Packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Publish to Registry | ||
uses: elgohr/[email protected] | ||
with: | ||
name: arquisoft/dede_es2a/webapp | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.DOCKER_PUSH_TOKEN }} | ||
registry: ghcr.io | ||
workdir: webapp | ||
docker-push-restapi: | ||
name: Push restapi Docker Image to GitHub Packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Publish to Registry | ||
uses: elgohr/[email protected] | ||
with: | ||
name: arquisoft/dede_es2a/restapi | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.DOCKER_PUSH_TOKEN }} | ||
registry: ghcr.io | ||
workdir: restapi | ||
deploy-webapp: | ||
needs: [docker-push-restapi,docker-push-webapp] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy webapp | ||
uses: akhileshns/[email protected] | ||
with: | ||
heroku_api_key: ${{ secrets.DEPLOY_KEY }} | ||
heroku_app_name: "dede-es2a-webapp" | ||
heroku_email: ${{ secrets.EMAIL }} | ||
usedocker: true | ||
appdir: "webapp" | ||
deploy-restapi: | ||
needs: [docker-push-restapi,docker-push-webapp] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy restapi | ||
uses: akhileshns/[email protected] | ||
with: | ||
heroku_api_key: ${{ secrets.DEPLOY_KEY }} | ||
heroku_app_name: "dede-es2a-restapi" | ||
heroku_email: ${{ secrets.EMAIL }} | ||
usedocker: true | ||
appdir: "restapi" | ||
*/ |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CI for ASW2122 | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
deploy-webapp: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy webapp | ||
uses: akhileshns/[email protected] | ||
with: | ||
heroku_api_key: ${{ secrets.DEPLOY_KEY }} | ||
heroku_app_name: "dede-es2a-webapp" | ||
heroku_email: ${{ secrets.EMAIL }} | ||
usedocker: true | ||
appdir: "webapp" | ||
docker_build_args: | | ||
API_URI | ||
env: | ||
API_URI: "https://dede-es2a-restapi.herokuapp.com" | ||
deploy-restapi: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy restapi | ||
uses: akhileshns/[email protected] | ||
with: | ||
heroku_api_key: ${{ secrets.DEPLOY_KEY }} | ||
heroku_app_name: "dede-es2a-restapi" | ||
heroku_email: ${{ secrets.EMAIL }} | ||
usedocker: true | ||
appdir: "restapi" | ||
docker_build_args: | | ||
MONGO_URI | ||
CLOUDINARY_NAME | ||
CLOUDINARY_API_KEY | ||
CLOUDINARY_API_SECRET | ||
env: | ||
MONGO_URI: ${{ secrets.MONGO_URI }} | ||
CLOUDINARY_NAME: ${{ secrets.CLOUD_NAME }} | ||
CLOUDINARY_API_KEY: ${{ secrets.CLOUD_KEY }} | ||
CLOUDINARY_API_SECRET: ${{ secrets.CLOUD_SECRET }} |
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 +1,2 @@ | ||
/node_modules | ||
/node_modules | ||
.env |
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
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
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 |
---|---|---|
|
@@ -2,17 +2,16 @@ | |
const mongoose = require('mongoose') | ||
require('dotenv').config() | ||
|
||
const database_uri = process.env.DB_CONNECT | ||
const database_test_uri = 'mongodb+srv://admin:<password>@cluster.mf7ve.mongodb.net/myFirstDatabase?retryWrites=true&w=majority' | ||
|
||
|
||
export function connect(){ | ||
mongoose.connect('mongodb+srv://admin:[email protected]/myFirstDatabase?retryWrites=true&w=majority', { | ||
|
||
mongoose.connect(process.env.MONGO_URI!, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true | ||
}) | ||
.then(() =>{ | ||
console.log("Database connected") | ||
}) | ||
; | ||
}); | ||
} | ||
|
||
export function connectTest(){ | ||
|
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
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
Oops, something went wrong.