Skip to content

Commit

Permalink
feat(actions): 🎉 add github-action integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Dec 15, 2023
1 parent 2402da9 commit 5adabd7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 54 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/public-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docker Image (public-dev)

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
environment:
name: public-dev

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/physical-robot-services-public:${{ steps.project_version.outputs.version }}-dev \
--build-arg APPLICATION_PORT=${{ secrets.APPLICATION_PORT }} \
--build-arg ROBOT_PORT=${{ secrets.ROBOT_PORT }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/physical-robot-services-public:${{ steps.project_version.outputs.version }}-dev
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:latest as build-stage
ARG APPLICATION_PORT
ARG ROBOT_PORT
COPY . /app
WORKDIR /app
RUN npm install
RUN npm run build
FROM node:latest as production-stage
COPY --from=build-stage /app/build /app
EXPOSE 8077
ENTRYPOINT [ "node" , "app/app.js" ]
7 changes: 2 additions & 5 deletions app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import rosBarcodeListenerJob from "./src/jobs/rosBarcodeListener.job";
import express, { Request, Response, NextFunction } from "express";
import rosTopicListenerJob from "./src/jobs/rosTopicListener.job";
import env from "./src/providers/environment.provider";
import logRouters from "./src/routes/log.routes";
import appRouters from "./src/routes/app.routes";
import bodyParser from "body-parser";
import cors from "cors";
import logRouters from "./src/routes/log.routes";
import foto from "./src/functions/foto";

async function app() {
async function app(): Promise<void> {
const app = express();

app.all("/*", function (req: Request, res: Response, next: NextFunction) {
Expand All @@ -26,8 +25,6 @@ async function app() {

app.use("/", appRouters);

foto();

app.use("/log", logRouters);

const server = app.listen(env.robot.port, async function () {
Expand Down
20 changes: 0 additions & 20 deletions app/src/functions/foto.ts

This file was deleted.

29 changes: 0 additions & 29 deletions app/src/functions/video.ts

This file was deleted.

0 comments on commit 5adabd7

Please sign in to comment.