Skip to content

Commit

Permalink
added build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
NivEz committed Aug 4, 2023
1 parent 2b9bc20 commit 5334d97
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on:
push:
branches: [ main ]

env:
DOCKER_USERNAME: nivezra

jobs:
build-client:
runs-on: ubuntu-latest
env:
DOCKER_REPO: nivezra/super-bulb-client
steps:
# - name: Checkout
# uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker build and push
uses: docker/build-push-action@v4
with:
context: "./client"
push: true
tags: ${{ env.DOCKER_REPO}}:latest
17 changes: 17 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:latest as builder

WORKDIR /app
COPY package.json /app/
COPY yarn.lock /app/

RUN yarn install --immutable

COPY ./client /app/
RUN yarn build

FROM nginx:latest
COPY --from=builder /app/dist/ /usr/share/nginx/html

EXPOSE 80

ENTRYPOINT ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port 3000",
"dev": "vite --port 8080",
"build": "vite build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
Expand Down

0 comments on commit 5334d97

Please sign in to comment.