Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Heroku deployment and support to CI/CD with Github Actions #62

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
33 changes: 20 additions & 13 deletions .github/workflows/full-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
mongodb-version: [4.2]

steps:
Expand All @@ -36,15 +36,22 @@ jobs:
- name: Run all tests
run: yarn test

- shell: bash
if: github.ref == 'refs/heads/master'
name: Create SSH deployment key
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: ./scripts/deploy.sh

- name: Deployment
if: github.ref == 'refs/heads/master'
run: git remote add umbler ssh://[email protected]:9922/jy4xooxj/waldemarnt2-com.git && git push umbler master
env:
CI: true
#- shell: bash
#if: github.ref == 'refs/heads/master'
#name: Create SSH deployment key
#env:
#SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
#run: ./scripts/deploy.sh

#- name: Deployment
#if: github.ref == 'refs/heads/master'
#run: git remote add umbler ssh://[email protected]:9922/jy4xooxj/waldemarnt2-com.git && git push umbler master
#env:
#CI: true

- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "peaceful-plateau-04699"
heroku_email: "[email protected]"
buildpack: "https://github.com/zidizei/heroku-buildpack-tsc#v2.0"
2 changes: 1 addition & 1 deletion config/custom-environment-variables.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"App": {
"port": "APP_PORT",
"port": "PORT",
"database": {
"mongoUrl": "MONGODB_URL"
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"build": "tsc",
"start": "yarn build && node dist/src/index.js",
"start": "node dist/src/index.js",
Copy link
Owner Author

@waldemarnt waldemarnt Aug 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Arrumar antes de publicar

"start:local": "dotenv -e .env -- ts-node-dev --transpile-only src/index.ts | pino-pretty -c",
"test": "yarn lint && yarn style:check && yarn test:unit && yarn test:functional",
"lint": "eslint ./src ./test --ext .ts",
Expand All @@ -15,6 +15,7 @@
"style:check": "prettier --check 'src/**/*.ts' 'test/**/*.ts'",
"style:fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'"
},
"postinstall": "yarn build",
"engines": { "node": ">=14" },
"repository": {
"type": "git",
Expand Down