Skip to content

Commit

Permalink
Merge pull request #133 from DNO-inc/prod-ready
Browse files Browse the repository at this point in the history
Add prod workflow
  • Loading branch information
DimonBor authored Apr 17, 2024
2 parents 3f4cbc9 + 938f8f2 commit 1b9d267
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-publish-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tres to Docker (Demo)

on:
push:
branches:
- dev

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

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

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ./Dockerfile-demo
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:18.16.0-alpine as tres-build-base

ENV VITE_API_URL="https://burrito.tres.cyberbydlo.com"
ENV VITE_WS_URL="wss://burrito.tres.cyberbydlo.com/ws"
ENV VITE_API_URL="https://tres.sumdu.edu.ua/api"
ENV VITE_WS_URL="wss://https://tres.sumdu.edu.ua/api/ws"

WORKDIR /app
COPY . /app
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile-demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:18.16.0-alpine as tres-build-base

ENV VITE_API_URL="https://burrito.tres.cyberbydlo.com"
ENV VITE_WS_URL="wss://burrito.tres.cyberbydlo.com/ws"

WORKDIR /app
COPY . /app
RUN npm config delete proxy
RUN npm install
RUN npm run build

FROM nginx:latest

COPY --from=tres-build-base /app/dist /usr/share/nginx/html
COPY ./etc/www/tres.svg /usr/share/nginx/html/tres.svg
COPY ./etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

0 comments on commit 1b9d267

Please sign in to comment.