diff --git a/.github/workflows/deploy-master.yml b/.github/workflows/deploy-master.yml index 8bf488427..a13428266 100644 --- a/.github/workflows/deploy-master.yml +++ b/.github/workflows/deploy-master.yml @@ -41,3 +41,23 @@ jobs: repository: ocamlsf/learn-ocaml-client target: client tags: master + push_emacs_client: + name: Push emacs-learn-ocaml-client image to Docker Hub + needs: push_client + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + # https://github.com/docker/build-push-action/tree/releases/v1#readme + uses: docker/build-push-action@v1 + with: + path: ci/docker-emacs-learn-ocaml-client + build_args: "base=ocamlsf/learn-ocaml-client,version=master" + always_pull: true + add_git_labels: true + labels: "org.opencontainers.image.version=master" + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ocamlsf/emacs-learn-ocaml-client + tags: master diff --git a/.github/workflows/deploy-tags.yml b/.github/workflows/deploy-tags.yml index 401aa7488..5f0eda320 100644 --- a/.github/workflows/deploy-tags.yml +++ b/.github/workflows/deploy-tags.yml @@ -46,3 +46,26 @@ jobs: target: client tags: latest tag_with_ref: true + push_emacs_client: + name: Push emacs-learn-ocaml-client image to Docker Hub + needs: push_client + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Get tag name + run: tag="${{ github.ref }}"; echo "::set-output name=tag::${tag#refs/tags/}" + id: tag + - name: Push to Docker Hub + # https://github.com/docker/build-push-action/tree/releases/v1#readme + uses: docker/build-push-action@v1 + with: + path: ci/docker-emacs-learn-ocaml-client + build_args: "base=ocamlsf/learn-ocaml-client,version=${{ steps.tag.outputs.tag }}" + always_pull: true + add_git_labels: true + labels: "org.opencontainers.image.version=${{ steps.tag.outputs.tag }}" + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ocamlsf/emacs-learn-ocaml-client + tags: ${{ steps.tag.outputs.tag }} diff --git a/ci/docker-emacs-learn-ocaml-client/.dockerignore b/ci/docker-emacs-learn-ocaml-client/.dockerignore new file mode 100644 index 000000000..0caa6a8cd --- /dev/null +++ b/ci/docker-emacs-learn-ocaml-client/.dockerignore @@ -0,0 +1,2 @@ +* +!.emacs diff --git a/ci/docker-emacs-learn-ocaml-client/.emacs b/ci/docker-emacs-learn-ocaml-client/.emacs new file mode 100644 index 000000000..1ad301607 --- /dev/null +++ b/ci/docker-emacs-learn-ocaml-client/.emacs @@ -0,0 +1,43 @@ +;;; .emacs --- Emacs conf file -*- coding: utf-8 -*- + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Config de package.el, MELPA et use-package + +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) +(eval-when-compile + (require 'use-package)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Config de Tuareg, Merlin et Company + +(use-package tuareg + :ensure t + :defer t + :init + (setq tuareg-opam-insinuate t)) + +;; Merlin would require OPAM ... + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Config générale + +(setq column-number-mode t + line-number-mode t + require-final-newline t) + +;; Marquage des parenthèses +(load-library "paren") +(show-paren-mode 1) + +;; Raccourcis C-c/C-x/C-v/C-z standards +;; au lieu de M-w/C-w/C-y/C-_ par défaut dans GNU Emacs +(cua-mode 1) diff --git a/ci/docker-emacs-learn-ocaml-client/Dockerfile b/ci/docker-emacs-learn-ocaml-client/Dockerfile new file mode 100644 index 000000000..807ae1446 --- /dev/null +++ b/ci/docker-emacs-learn-ocaml-client/Dockerfile @@ -0,0 +1,31 @@ +ARG base=ocamlsf/learn-ocaml-client +ARG version=master +FROM ${base}:${version} + +WORKDIR /home/learn-ocaml + +USER root + +RUN apk add --no-cache \ + bash \ + curl \ + emacs-nox \ + make \ + && mkdir -p -v bin \ + && chown -v learn-ocaml:learn-ocaml bin + +ENV PATH /home/learn-ocaml/bin:${PATH} + +ENV LANG C.UTF-8 +# ENV LC_ALL C.UTF-8 +# ENV LANGUAGE en_US:en + +COPY --chown=learn-ocaml:learn-ocaml .emacs .emacs + +USER learn-ocaml + +# Do some automatic Emacs installation/byte-compilation: +RUN emacs --version && emacs --batch -l ${HOME}/.emacs + +ENTRYPOINT [] +CMD ["/bin/sh"]