diff --git a/.github/workflows/on_push_branch__execute_tests.yml b/.github/workflows/on_push_branch__execute_tests.yml index d183122..00fc104 100644 --- a/.github/workflows/on_push_branch__execute_tests.yml +++ b/.github/workflows/on_push_branch__execute_tests.yml @@ -10,7 +10,7 @@ jobs: # Currently, this need to be synced manually with the Dockerfile. In the future, the workflow should be changed, # so that a development container is built from the Dockerfile, pushed, and then re-used in the following steps. # This would also remove the need to install cmake manually in each step: - container: hexpm/elixir:1.13.4-erlang-25.1.1-debian-bullseye-20220801-slim + container: hexpm/elixir:1.13.4-erlang-25.3.2.8-debian-bullseye-20231009-slim steps: # See https://github.com/actions/checkout @@ -37,7 +37,7 @@ jobs: # Containers must run in Linux based operating systems runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in - container: hexpm/elixir:1.13.4-erlang-25.1.1-debian-bullseye-20220801-slim + container: hexpm/elixir:1.13.4-erlang-25.3.2.8-debian-bullseye-20231009-slim needs: build_deps @@ -92,7 +92,7 @@ jobs: check_mix_format: runs-on: ubuntu-latest - container: hexpm/elixir:1.13.4-erlang-25.1.1-debian-bullseye-20220801-slim + container: hexpm/elixir:1.13.4-erlang-25.3.2.8-debian-bullseye-20231009-slim needs: build_deps diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a8806af --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Create and publish a Docker image + +on: + push: + branches: + - main + release: + types: [published] + +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: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64,linux/arm64/v8 + target: production + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index cf07fd4..1ddd907 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,8 @@ # - Ex: hexpm/elixir:1.13.3-erlang-24.3.4.2-debian-bullseye-20210902-slim # ARG ELIXIR_VERSION=1.13.4 -ARG OTP_VERSION=25.1.1 -ARG DEBIAN_VERSION=bullseye-20220801-slim +ARG OTP_VERSION=25.3.2.8 +ARG DEBIAN_VERSION=bullseye-20231009-slim ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}" @@ -32,21 +32,21 @@ RUN apt-get -y update && apt-get install -y curl # install build dependencies RUN curl -fsSL $NODE_URL | bash - && \ - apt-get install -y nodejs \ - build-essential \ - inotify-tools \ - postgresql-client \ - git \ - cmake && \ - apt-get clean && \ - rm -f /var/lib/apt/lists/*_* + apt-get install -y nodejs \ + build-essential \ + inotify-tools \ + postgresql-client \ + git \ + cmake && \ + apt-get clean && \ + rm -f /var/lib/apt/lists/*_* # prepare build dir WORKDIR /app # install hex + rebar RUN mix local.hex --force && \ - mix local.rebar --force + mix local.rebar --force # This is the image we use during development: FROM base as development @@ -65,6 +65,7 @@ FROM base as production_builder # set build ENV ENV MIX_ENV="prod" ENV NODE_ENV="production" +ENV ERL_FLAGS="+JPperf true" # install mix dependencies COPY mix.exs mix.lock ./