-
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 #73 from FedeMont/release
First production deploy
- Loading branch information
Showing
57 changed files
with
26,240 additions
and
0 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,62 @@ | ||
# 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://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# This is used to load Environment-level secrets, from the specified environment. | ||
# Instead, repository secrets are loaded by default. | ||
environment: production | ||
|
||
env: | ||
token_safe: ${{ secrets.TOKEN_SAFE }} # Must be set as a GitHub secret | ||
positionstack_api_key: ${{ secrets.POSITIONSTACK_API }} # Must be set as a GitHub secret | ||
db_url: ${{ secrets.DB_URL }} # Must be set as a GitHub secret | ||
db_name: ${{ secrets.DB_NAME }} # Must be set as a GitHub secret | ||
db_user: ${{ secrets.DB_USER }} # Must be set as a GitHub secret | ||
db_password: ${{ secrets.DB_PASSWORD }} # Must be set as a GitHub secret | ||
emailer_user: ${{ secrets.EMAILER_USER }} # Must be set as a GitHub secret | ||
emailer_clientId: ${{ secrets.EMAILER_CLIENTID }} # Must be set as a GitHub secret | ||
emailer_clientSecret: ${{ secrets.EMAILER_CLIENTSECRET }} # Must be set as a GitHub secret | ||
emailer_refreshToken: ${{ secrets.EMAILER_REFRESHTOKEN }} # Must be set as a GitHub secret | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
cache-dependency-path: node/package-lock.json | ||
- run: npm ci | ||
working-directory: node | ||
- run: npm run build --if-present | ||
working-directory: node | ||
- run: npm test | ||
working-directory: node | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: akhileshns/[email protected] # This is the action | ||
with: | ||
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | ||
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} | ||
heroku_email: "[email protected]" |
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,3 +1,7 @@ | ||
database/* | ||
*.DS_Store | ||
*.idea | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
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,47 @@ | ||
version: "3.2" | ||
networks: | ||
default: | ||
driver: bridge | ||
|
||
services: | ||
nodejs: | ||
image: node:18.1.0 | ||
working_dir: /home/node/app | ||
restart: unless-stopped | ||
environment: | ||
- NODE_ENV=production | ||
volumes: | ||
- ./node/:/home/node/app | ||
ports: | ||
- 3000:3000 | ||
command: bash -c "npm i && npm run start-dev" | ||
# networks: | ||
# - partyhub | ||
mongo: | ||
image: mongo:4.4.13 | ||
container_name: mongo | ||
restart: unless-stopped | ||
environment: | ||
MONGO_INITDB_ROOT_USERNAME: root | ||
MONGO_INITDB_ROOT_PASSWORD: password | ||
volumes: | ||
- ./database/db:/data/db | ||
- ./database/dev.archive:/Databases/dev.archive | ||
- ./database/production:/Databases/production | ||
ports: | ||
- 27017:27017 | ||
# networks: | ||
# - partyhub | ||
mongo-express: | ||
image: mongo-express:0.54.0 | ||
restart: unless-stopped | ||
environment: | ||
ME_CONFIG_MONGODB_ADMINUSERNAME: root | ||
ME_CONFIG_MONGODB_ADMINPASSWORD: password | ||
ME_CONFIG_MONGODB_URL: mongodb://root:password@mongo:27017/ | ||
ports: | ||
- 8081:8081 | ||
depends_on: | ||
- mongo | ||
# networks: | ||
# - partyhub |
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 @@ | ||
require("dotenv").config() |
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 @@ | ||
web: node app.js |
Oops, something went wrong.