Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI

on:
pull_request:
push:
branches:
- main
on: [push, pull_request]

jobs:
test:
Expand All @@ -16,8 +12,8 @@ jobs:

- uses: erlef/setup-elixir@v1
with:
otp-version: 25.2.1
elixir-version: 1.14.3
otp-version: 27.2
elixir-version: 1.17.3

- run: mix deps.get
- run: mix deps.compile
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM hexpm/elixir:1.14.3-erlang-25.2.1-alpine-3.17.0 as build
ARG ELIXIR_VERSION=1.17.3
ARG ERLANG_VERSION=27.2
ARG ALPINE_VERSION=3.20.3

FROM hexpm/elixir:${ELIXIR_VERSION}-erlang-${ERLANG_VERSION}-alpine-${ALPINE_VERSION} AS build

# install build dependencies
RUN apk add --update git build-base nodejs yarn
Expand Down Expand Up @@ -32,11 +36,11 @@ RUN mix compile

# build release
COPY rel rel
RUN mix release
RUN mix do sentry.package_source_code, release

# prepare release image
FROM alpine:3.17.0 AS app
RUN apk add --update bash openssl libstdc++
FROM alpine:${ALPINE_VERSION} AS app
RUN apk add --no-cache --update bash openssl libstdc++

RUN mkdir /app
WORKDIR /app
Expand Down
23 changes: 11 additions & 12 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
"phoenix_live_view": "file:../deps/phoenix_live_view"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^3.4.2",
"css-minimizer-webpack-plugin": "^4.2.2",
"mini-css-extract-plugin": "^2.7.2",
"sass": "^1.35.2",
"sass-loader": "^8.0.2",
"terser-webpack-plugin": "^2.3.2",
"webpack": "^5.1.0",
"webpack-cli": "^4.x.x"
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.1",
"css-minimizer-webpack-plugin": "^6.0.0",
"mini-css-extract-plugin": "^2.8.1",
"sass-loader": "^14.2.0",
"sass": "^1.74.1",
"webpack-cli": "^5.1.4",
"webpack": "5.91.0"
}
}
44 changes: 19 additions & 25 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,46 @@
const path = require('path');
const glob = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = (env, options) => {
const devMode = options.mode !== 'production';

return {
optimization: {
minimizer: [
new TerserPlugin({ cache: true, parallel: true, sourceMap: devMode }),
new TerserPlugin(),
new CssMinimizerPlugin(),
]
},
entry: {
'app': glob.sync('./vendor/**/*.js').concat(['./js/app.js'])
},
entry: [
'./js/app.js'
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, '../priv/static/js'),
publicPath: '/js/',
filename: 'js/app.js',
path: path.resolve(__dirname, '../priv/static'),
},
mode: devMode ? 'development' : 'production',
devtool: devMode ? 'eval-cheap-module-source-map' : undefined,
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.[s]?css$/,
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
{
loader: "css-loader",
options: { url: false }
},
"sass-loader"
]
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
}
]
},
plugins: [
new MiniCssExtractPlugin({ filename: '../css/app.css' }),
new CopyWebpackPlugin({ patterns: [{ from: 'static/', to: '../' }] })
new MiniCssExtractPlugin({ filename: 'css/app.css' }),
new CopyWebpackPlugin({ patterns: [{ from: 'static/', to: '.' }] }),
]
}
};
Loading