Skip to content

Commit df77336

Browse files
committed
try this
1 parent bfd0380 commit df77336

File tree

9 files changed

+128
-0
lines changed

9 files changed

+128
-0
lines changed

.github/workflows/pipeline.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 }}

client/components/App 2.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
)

client/components/Footer 2.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

client/components/NavBar 2.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

client/util/common 2.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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'

config/common 2.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
}

server/util/common 2.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const common = require('@root/config/common')
2+
3+
const PORT = process.env.PORT || 8000
4+
5+
module.exports = {
6+
...common,
7+
PORT,
8+
}

server/util/routes 2.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

0 commit comments

Comments
 (0)