File tree Expand file tree Collapse file tree 4 files changed +75
-3
lines changed Expand file tree Collapse file tree 4 files changed +75
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,37 @@ jobs:
22
22
23
23
- name : 🚀 Release
24
24
uses : gsmlg/semantic-release-action@v3
25
+ id : semantic
25
26
with :
26
27
release_name : gsmlg
27
28
working-directory : ' elixir/gsmlg_umbrella'
28
29
env :
29
30
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
31
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
32
+ -
33
+ name : Set up QEMU
34
+ uses : docker/setup-qemu-action@v1
35
+ -
36
+ name : Set up Docker Buildx
37
+ uses : docker/setup-buildx-action@v1
38
+ -
39
+ name : Login to DockerHub
40
+ uses : docker/login-action@v1
41
+ with :
42
+ username : ${{ secrets.DOCKERHUB_USER }}
43
+ password : ${{ secrets.DOCKERHUB_PASSWD }}
44
+ -
45
+ name : Build and push
46
+ uses : docker/build-push-action@v2
47
+ with :
48
+ context : elixir/gsmlg_umbrella
49
+ file : elixir/gsmlg_umbrella/Dockerfile
50
+ platforms : linux/amd64,linux/arm64/v8
51
+ push : true
52
+ build-args : |
53
+ ELIXIR_VERSION=${{ steps.semantic.outputs.new_release_version }}
54
+ tags : |
55
+ docker.io/gsmlg/gsmlg.org:v${{ steps.semantic.outputs.new_release_version }}
56
+ docker.io/gsmlg/gsmlg.org:latest
57
+
31
58
Original file line number Diff line number Diff line change
1
+ FROM gsmlg/phoenix:alpine AS builder
2
+
3
+ ARG MIX_ENV=prod
4
+ ARG NAME=gsmlg
5
+ ARG RELEASE_VERSION=0.1.0
6
+
7
+ COPY . /build
8
+
9
+ WORKDIR /build
10
+
11
+ RUN apk update && apk add curl jq \
12
+ && mix do deps.get, compile \
13
+ && cd apps/gsmlg_web && mix assets.deploy && cd ../.. \
14
+ && curl -Lf $(npm info --json $package | jq -r .dist.tarball) -o website.tgz \
15
+ && tar xzf website.tgz --strip-components=2 -C apps/gsmlg_web/priv/static \
16
+ && mix distillery.release --env=prod \
17
+ && mkdir /app \
18
+ && tar zxvf "$(find _build/prod/rel -name gsmlg_umbrella.tar.gz)" -C /app \
19
+ && rm -rf /var/cache/apk/*
20
+
21
+ FROM alpine:3.14
22
+
23
+ ARG RELEASE_VERSION=0.1.0
24
+
25
+ LABEL maintainer="GSMLG <gsmlg.com@gmail.com>"
26
+ LABEL RELEASE_VERSION="${RELEASE_VERSION}"
27
+
28
+ ENV PORT=80 \
29
+ REPLACE_OS_VARS=true \
30
+ ERL_EPMD_PORT=4369 \
31
+ POD_IP=127.0.0.1 \
32
+ ERLCOOKIE=erlang_cookie \
33
+ DATABASE_URL=ecto://USER:PASS@HOST/DATABASE \
34
+ POOL_SIZE=10 \
35
+ SECRET_KEY_BASE=gsmlg_umbrella
36
+
37
+ RUN apk update \
38
+ && apk add openssl \
39
+ && rm -rf /var/cache/apk/*
40
+
41
+ COPY --from=builder /app /app
42
+
43
+ EXPOSE 80 4369
44
+
45
+ ENTRYPOINT ["/app/bin/gsmlg" , "foreground" ]
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ if config_env() == :prod do
41
41
# If you are doing OTP releases, you need to instruct Phoenix
42
42
# to start each relevant endpoint:
43
43
#
44
- # config :gsmlg_web, GSMLGWeb.Endpoint, server: true
45
- #
44
+ config :gsmlg_web , GSMLGWeb.Endpoint , server: true
45
+
46
46
# Then you can assemble a release by calling `mix release`.
47
47
# See `mix help release` for more information.
48
48
Original file line number Diff line number Diff line change 47
47
# will be used by default
48
48
49
49
release :gsmlg_umbrella do
50
- set version: current_version ( :gsmlg_umbrella )
50
+ set version: System . get_env ( "RELEASE_VERSION" , current_version ( :gsmlg_web ) )
51
51
set applications: [
52
52
:runtime_tools ,
53
53
gsmlg: :permanent ,
You can’t perform that action at this time.
0 commit comments