Skip to content

Commit

Permalink
chore: Deploy ocamlsf/emacs-learn-ocaml-client:{master,$tags} (ocaml-…
Browse files Browse the repository at this point in the history
…sf#433)

(for CI purpose)
  • Loading branch information
erikmd authored Oct 4, 2021
1 parent adbb063 commit dce8f00
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 23 additions & 0 deletions .github/workflows/deploy-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions ci/docker-emacs-learn-ocaml-client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.emacs
43 changes: 43 additions & 0 deletions ci/docker-emacs-learn-ocaml-client/.emacs
Original file line number Diff line number Diff line change
@@ -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)
31 changes: 31 additions & 0 deletions ci/docker-emacs-learn-ocaml-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit dce8f00

Please sign in to comment.