Skip to content

Commit 3c8cc09

Browse files
authored
Merge pull request #1 from atielking98/pipeline
try
2 parents eab6fda + b49b2c7 commit 3c8cc09

File tree

7 files changed

+8922
-7263
lines changed

7 files changed

+8922
-7263
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fly.toml
2+
Dockerfile
3+
.dockerignore
4+
node_modules
5+
.git

.github/workflows/pipeline.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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: |
30+
${{ github.event_name == 'push' }} &&
31+
!contains(join(toJson(github.event.commits.*.message), ' '), '#skip')
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: superfly/flyctl-actions/setup-flyctl@master
35+
- run: flyctl deploy --remote-only
36+
env:
37+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
38+
tag_release:
39+
needs: [deploy]
40+
permissions: write-all
41+
runs-on: ubuntu-latest
42+
if: |
43+
${{ github.event_name == 'push' }} &&
44+
!contains(join(toJson(github.event.commits.*.message), ' '), '#skip')
45+
steps:
46+
- uses: actions/checkout@v3
47+
with:
48+
fetch-depth: '0'
49+
- name: Bump version and push tag
50+
uses: anothrNick/github-tag-action@eca2b69f9e2c24be7decccd0f15fdb1ea5906598
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM debian:bullseye as builder
2+
3+
ARG NODE_VERSION=16.16.0
4+
5+
RUN apt-get update; apt install -y curl python-is-python3 pkg-config build-essential
6+
RUN curl https://get.volta.sh | bash
7+
ENV VOLTA_HOME /root/.volta
8+
ENV PATH /root/.volta/bin:$PATH
9+
RUN volta install node@${NODE_VERSION}
10+
11+
#######################################################################
12+
13+
RUN mkdir /app
14+
WORKDIR /app
15+
16+
# NPM will not install any package listed in "devDependencies" when NODE_ENV is set to "production",
17+
# to install all modules: "npm install --production=false".
18+
# Ref: https://docs.npmjs.com/cli/v9/commands/npm-install#description
19+
20+
ENV NODE_ENV production
21+
22+
COPY . .
23+
24+
RUN npm install && npm run build
25+
FROM debian:bullseye
26+
27+
LABEL fly_launch_runtime="nodejs"
28+
29+
COPY --from=builder /root/.volta /root/.volta
30+
COPY --from=builder /app /app
31+
32+
WORKDIR /app
33+
ENV NODE_ENV production
34+
ENV PATH /root/.volta/bin:$PATH
35+
36+
CMD [ "npm", "run", "start" ]

client/components/MessageView/MessageList.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ const MessageList = ({ messages, deleteMessage }) => {
2121
)
2222
}
2323

24-
2524
export default MessageList

fly.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# fly.toml file generated for twilight-river-2470 on 2023-03-02T19:18:54-05:00
2+
3+
app = "twilight-river-2470"
4+
kill_signal = "SIGINT"
5+
kill_timeout = 5
6+
processes = []
7+
8+
[env]
9+
PORT = "8080"
10+
11+
[experimental]
12+
auto_rollback = true
13+
14+
[[services]]
15+
http_checks = []
16+
internal_port = 8080
17+
processes = ["app"]
18+
protocol = "tcp"
19+
script_checks = []
20+
[services.concurrency]
21+
hard_limit = 25
22+
soft_limit = 20
23+
type = "connections"
24+
25+
[[services.ports]]
26+
force_https = true
27+
handlers = ["http"]
28+
port = 80
29+
30+
[[services.ports]]
31+
handlers = ["tls", "http"]
32+
port = 443
33+
34+
[[services.tcp_checks]]
35+
grace_period = "1s"
36+
interval = "15s"
37+
restart_limit = 0
38+
timeout = "2s"

0 commit comments

Comments
 (0)