Skip to content

Commit

Permalink
Update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aeifn committed Dec 27, 2023
1 parent 0383024 commit d693a2a
Show file tree
Hide file tree
Showing 8 changed files with 333 additions and 53 deletions.
9 changes: 1 addition & 8 deletions .docker/backend.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
COPY ./.docker/imagick-policy.xml /etc/ImageMagick-6/policy.xml

FROM node:${NODE_TAG} AS builder
WORKDIR /build
COPY package.json .
RUN npm install
COPY . .
RUN npm run build

FROM base
WORKDIR /code
ENV NODE_ENV production
COPY --from=builder /appBuild/ .
COPY ./appBuild/ .
RUN npm install --production
RUN mkdir /store && chown node:node /store
RUN mkdir /sitemap && chown node:node /sitemap
Expand Down
11 changes: 1 addition & 10 deletions .docker/frontend.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
ARG NODE_TAG=16.19.0

FROM node:${NODE_TAG} AS builder
WORKDIR /build
COPY package.json .
RUN npm install
COPY . .
RUN npm run build

FROM nginx:1.21.3
COPY --from=builder /appBuild/public/ /usr/share/nginx/html/
COPY ./appBuild/public/ /usr/share/nginx/html/
17 changes: 16 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,24 @@ jobs:
if: github.repository_owner == 'pastvu'
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.19.0

- name: Build
run: |
npm ci
npm run build
- name: Sentry
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
npm run sentry:sourcemaps
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/node.js.yml

This file was deleted.

9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ public/style/**/*.css

# Output from babel/transpile #
######################
babel/output*.js
babel/output*.js

# Sentry Config File
.sentryclirc

# Grunt output
appBuild
app*.zip
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (grunt) {
const path = require('path');
const Utils = require('./commons/Utils');
const env = grunt.option('env') || 'production'; // Например, --env testing
const upperDir = path.normalize(path.resolve('../') + '/');
const upperDir = path.normalize(path.resolve('./') + '/');
const targetDir = path.normalize(upperDir + 'appBuild/');
const babelConfig = require('./babel/server.config');
const hash = Utils.randomString(5);
Expand Down Expand Up @@ -103,6 +103,7 @@ module.exports = function (grunt) {
},
uglify: {
options: {
sourceMap: true,
output: {
comments: false,
},
Expand Down
Loading

0 comments on commit d693a2a

Please sign in to comment.