File tree Expand file tree Collapse file tree 9 files changed +128
-0
lines changed Expand file tree Collapse file tree 9 files changed +128
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deployment pipeline
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ branches : [master]
9+ types : [opened, synchronize]
10+
11+ jobs :
12+ deployment_prep :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v3
16+ - uses : actions/setup-node@v2
17+ with :
18+ node-version : ' 16'
19+ - name : npm install
20+ run : npm install
21+ - name : lint
22+ run : npm run lint
23+ - name : build
24+ run : npm run build
25+ deploy :
26+ name : Deploy app
27+ needs : [deployment_prep]
28+ runs-on : ubuntu-latest
29+ if : ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ''), '#skip
30+ steps :
31+ - uses : actions/checkout@v3
32+ - uses : superfly/flyctl-actions/setup-flyctl@master
33+ - run : flyctl deploy --remote-only
34+ env :
35+ FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
36+ tag_release :
37+ needs : [deploy]
38+ permissions : write-all
39+ runs-on : ubuntu-latest
40+ if : ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ''), '#skip
41+ steps :
42+ - uses : actions/checkout@v3
43+ with :
44+ fetch-depth : ' 0'
45+ - name : Bump version and push tag
46+ uses : anothrNick/github-tag-action@eca2b69f9e2c24be7decccd0f15fdb1ea5906598
47+ env :
48+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import NavBar from 'Components/NavBar'
3+ import Footer from 'Components/Footer'
4+ import Router from 'Components/Router'
5+
6+ export default ( ) => (
7+ < >
8+ < NavBar />
9+ < Router />
10+ < Footer />
11+ </ >
12+ )
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { images } from 'Utilities/common'
3+
4+ const Footer = ( ) => (
5+ < div className = "footer" >
6+ < img src = { images . toskaLogo } alt = "toska" />
7+ </ div >
8+ )
9+
10+ export default Footer
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+
3+ const FrontPage = ( ) => (
4+ < >
5+ Welcome
6+ < a href = "/messages" > Messages</ a >
7+ </ >
8+ )
9+
10+ export default FrontPage
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { images } from 'Utilities/common'
3+
4+ const NavBar = ( ) => (
5+ < div className = "navbar" >
6+ < img src = { images . toskaLogo } alt = "toska" />
7+ </ div >
8+ )
9+
10+ export default NavBar
Original file line number Diff line number Diff line change 1+ /**
2+ * Insert common items for frontend here
3+ */
4+ import toskaLogo from 'Assets/toskalogo_color.svg'
5+
6+ export const images = {
7+ toskaLogo,
8+ }
9+
10+ // Everything from application wide common items is available through here
11+ export * from '@root/config/common'
Original file line number Diff line number Diff line change 1+ /**
2+ * Insert application wide common items here, they're all exported by frontend and backend common.js respectively
3+ */
4+
5+ const inProduction = process . env . NODE_ENV === 'production'
6+
7+ module . exports = {
8+ inProduction,
9+ }
Original file line number Diff line number Diff line change 1+ const common = require ( '@root/config/common' )
2+
3+ const PORT = process . env . PORT || 8000
4+
5+ module . exports = {
6+ ...common ,
7+ PORT ,
8+ }
Original file line number Diff line number Diff line change 1+ const Router = require ( 'express' )
2+ const messages = require ( '@controllers/messagesController' )
3+
4+ const router = Router ( )
5+
6+ router . get ( '/messages' , messages . getAll )
7+ router . post ( '/messages' , messages . create )
8+ router . delete ( '/messages/:id' , messages . destroy )
9+
10+ module . exports = router
You can’t perform that action at this time.
0 commit comments