Skip to content

Commit f75591f

Browse files
committed
chore: new deploy action and bump Dockerfile
1 parent aac3166 commit f75591f

5 files changed

Lines changed: 65 additions & 17 deletions

File tree

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Publish
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
tags:
8+
- "v*"
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Login to GitHub Container Registry
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ghcr.io/${{ github.repository_owner }}/live-react-examples
35+
tags: |
36+
type=semver,pattern={{version}}
37+
type=semver,pattern={{major}}.{{minor}}
38+
type=raw,value=latest
39+
40+
- name: Build and push
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: ./live_react_examples
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
include:
22-
- elixir: 1.18.1
23-
erlang: 27.2.0
22+
- elixir: 1.19.5
23+
erlang: 27.3.4.10
2424
name: Elixir v${{ matrix.elixir }}, Erlang v${{ matrix.erlang }}
2525
steps:
2626
- uses: actions/checkout@v4

live_react_examples/Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
# This file is based on these images:
88
#
99
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image
10-
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20240612-slim - for the release image
10+
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bookworm-slim - for the release image
1111
# - https://pkgs.org/ - resource for finding needed packages
12-
# - Ex: hexpm/elixir:1.17.1-erlang-26.2.5.1-debian-bullseye-20240612-slim
12+
# - Ex: hexpm/elixir:1.18.1-erlang-27.2.0-debian-bookworm-20250113-slim
1313
#
14-
ARG ELIXIR_VERSION=1.17.3
15-
ARG OTP_VERSION=27.1.1
16-
ARG DEBIAN_VERSION=bookworm-20240926
14+
ARG ELIXIR_VERSION=1.19.5
15+
ARG OTP_VERSION=27.3.4.10
16+
ARG DEBIAN_VERSION=bookworm-20260406-slim
1717

1818
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
1919
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
2020

21-
FROM ${BUILDER_IMAGE} as builder
21+
FROM ${BUILDER_IMAGE} AS builder
2222

2323
# install build dependencies
2424
RUN apt-get update -y && apt-get install -y build-essential git curl \
2525
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
2626

2727
# install nodejs for build stage
28-
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && apt-get install -y nodejs
28+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
2929

3030
# prepare build dir
3131
WORKDIR /app
@@ -77,15 +77,15 @@ RUN apt-get update -y && \
7777
apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates curl \
7878
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
7979

80-
# install nodejs for production environment
81-
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && apt-get install -y nodejs
80+
# install nodejs for production environment (needed for SSR)
81+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
8282

8383
# Set the locale
8484
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
8585

86-
ENV LANG en_US.UTF-8
87-
ENV LANGUAGE en_US:en
88-
ENV LC_ALL en_US.UTF-8
86+
ENV LANG=en_US.UTF-8
87+
ENV LANGUAGE=en_US:en
88+
ENV LC_ALL=en_US.UTF-8
8989

9090
WORKDIR "/app"
9191
RUN chown nobody /app

live_react_examples/assets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"clsx": "^2.1.1",
2525
"framer-motion": "^11.2.11",
2626
"highlight.js": "^11.10.0",
27-
"live_react": "file:../..",
27+
"live_react": "file:../deps/live_react",
2828
"phoenix": "file:../deps/phoenix",
2929
"phoenix_html": "file:../deps/phoenix_html",
3030
"phoenix_live_view": "file:../deps/phoenix_live_view",

live_react_examples/mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ defmodule LiveReactExamples.MixProject do
5252
{:dns_cluster, "~> 0.1.1"},
5353
{:bandit, "~> 1.5"},
5454
# For development
55-
{:live_react, path: ".."}
55+
# {:live_react, path: ".."}
5656
# For deployment
57-
# {:live_react, "~> 1.0.0"}
57+
{:live_react, "~> 1.1.0"}
5858
]
5959
end
6060

0 commit comments

Comments
 (0)