File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 OCTOKIT_TOKEN : ${{ secrets.OCTOKIT_TOKEN }}
3434 AUTH_CLIENT_ID : ${{ secrets.AUTH_CLIENT_ID }}
3535 AUTH_CLIENT_SECRET : ${{ secrets.AUTH_CLIENT_SECRET }}
36- run : npm test
36+ run : npm test
37+
38+ deploy :
39+
40+ runs-on : ubuntu-latest
41+ needs : [build]
42+ steps :
43+ - uses : actions/checkout@v3
44+ - name : Deploy to Heroku
45+ uses : AkhileshNS/heroku-deploy@v3.12.12
46+ with :
47+ heroku_api_key : ${{ secrets.HEROKU_API_KEY }}
48+ heroku_email : " yurii.pakhota@sigma.software"
49+ heroku_app_name : " pet-github-react-app"
Original file line number Diff line number Diff line change 1+ web : npm start
Original file line number Diff line number Diff line change @@ -34,8 +34,17 @@ function getConfig(): Config {
3434 } ) ;
3535 return {
3636 ...envConfig . parsed ,
37- PORT : envConfig . parsed ?. PORT ? parseInt ( envConfig ?. parsed ?. PORT ) : 8080 ,
37+ PORT : getPort ( ) ,
3838 } as Config ;
3939}
4040
41+ function getPort ( ) : number {
42+ if ( envConfig . parsed ?. PORT ) {
43+ return parseInt ( envConfig . parsed . PORT ) ;
44+ } else if ( process . env . PORT ) {
45+ return parseInt ( process . env . PORT ) ;
46+ }
47+ return 8080 ;
48+ }
49+
4150export const config : Config = getConfig ( ) ;
You can’t perform that action at this time.
0 commit comments