Skip to content

Commit ac11ad5

Browse files
committed
chore: Add push_emacs_client, a conditional deploy job
1 parent 18da153 commit ac11ad5

File tree

4 files changed

+160
-0
lines changed

4 files changed

+160
-0
lines changed

.github/workflows/deploy-oauth-moodle.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,27 @@ jobs:
4747
repository: pfitaxel/learn-ocaml-client
4848
target: client
4949
tags: ${{ steps.branch.outputs.branch }}
50+
push_emacs_client:
51+
name: Push emacs-learn-ocaml-client image to Docker Hub
52+
needs: push_client
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Check out the repo
56+
uses: actions/checkout@v2
57+
- name: Get branch name
58+
run: branch="${{ github.ref }}"; echo "::set-output name=branch::${branch#refs/heads/}"
59+
id: branch
60+
- name: Push to Docker Hub
61+
# https://github.com/docker/build-push-action/tree/releases/v1#readme
62+
uses: docker/build-push-action@v1
63+
with:
64+
path: ci/docker-emacs-learn-ocaml-client
65+
build_args: "base=pfitaxel/learn-ocaml-client,version=${{ steps.branch.outputs.branch }}"
66+
always_pull: true
67+
add_git_labels: true
68+
labels: "org.opencontainers.image.version=${{ steps.branch.outputs.branch }}"
69+
username: ${{ secrets.DOCKER_USERNAME }}
70+
password: ${{ secrets.DOCKER_PASSWORD }}
71+
# repository: ocamlsf/learn-ocaml
72+
repository: pfitaxel/emacs-learn-ocaml-client
73+
tags: ${{ steps.branch.outputs.branch }}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.emacs
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
;;; .emacs --- Emacs conf file -*- coding: utf-8 -*-
2+
3+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4+
5+
;; Config de package.el, MELPA et use-package
6+
7+
(require 'package)
8+
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
9+
(package-initialize)
10+
11+
(unless (package-installed-p 'use-package)
12+
(package-refresh-contents)
13+
(package-install 'use-package))
14+
(eval-when-compile
15+
(require 'use-package))
16+
17+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18+
19+
;; Config de Tuareg, Merlin et Company
20+
21+
(use-package tuareg
22+
:ensure t
23+
:defer t
24+
:init
25+
(setq tuareg-opam-insinuate t))
26+
27+
;; Merlin would require OPAM
28+
; (use-package merlin
29+
; :ensure t
30+
; :hook
31+
; ((tuareg-mode caml-mode) . merlin-mode)
32+
; :config
33+
; (setq merlin-command 'opam))
34+
;
35+
; (use-package merlin-eldoc
36+
; :ensure t
37+
; :hook
38+
; ((tuareg-mode caml-mode) . merlin-eldoc-setup)
39+
; :bind (:map merlin-mode-map
40+
; ("C-c <C-left>" . merlin-eldoc-jump-to-prev-occurrence)
41+
; ("C-c <C-right>" . merlin-eldoc-jump-to-next-occurrence)))
42+
;
43+
; (use-package company
44+
; :ensure t
45+
; :hook
46+
; ((tuareg-mode caml-mode) . company-mode)
47+
; :config
48+
; (bind-key "<backtab>" 'company-complete))
49+
50+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51+
52+
;; Config de Magit
53+
54+
; (use-package magit
55+
; :ensure t
56+
; :defer t
57+
; :config
58+
; (setq magit-diff-refine-hunk 'all)
59+
; :bind (("C-x g" . magit-status)
60+
; ("C-x M-g" . magit-dispatch-popup)))
61+
;
62+
; (use-package magit-gitflow
63+
; :ensure t
64+
; :after magit
65+
; :config (add-hook 'magit-mode-hook 'turn-on-magit-gitflow))
66+
;
67+
; ;; Protect against accident pushes to upstream
68+
; (defadvice magit-push-current-to-upstream
69+
; (around my-protect-accidental-magit-push-current-to-upstream)
70+
; "Protect against accidental push to upstream.
71+
;
72+
; Causes `magit-git-push' to ask the user for confirmation first."
73+
; (let ((my-magit-ask-before-push t))
74+
; ad-do-it))
75+
;
76+
; (defadvice magit-git-push (around my-protect-accidental-magit-git-push)
77+
; "Maybe ask the user for confirmation before pushing.
78+
;
79+
; Advice to `magit-push-current-to-upstream' triggers this query."
80+
; (if (bound-and-true-p my-magit-ask-before-push)
81+
; ;; Arglist is (BRANCH TARGET ARGS)
82+
; (if (yes-or-no-p (format "Push %s branch upstream to %s? "
83+
; (ad-get-arg 0) (ad-get-arg 1)))
84+
; ad-do-it
85+
; (error "Push to upstream aborted by user"))
86+
; ad-do-it))
87+
;
88+
; (ad-activate 'magit-push-current-to-upstream)
89+
; (ad-activate 'magit-git-push)
90+
91+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
92+
93+
;; Config générale
94+
95+
(setq column-number-mode t
96+
line-number-mode t
97+
require-final-newline t)
98+
99+
;; Marquage des parenthèses
100+
(load-library "paren")
101+
(show-paren-mode 1)
102+
103+
;; Raccourcis C-c/C-x/C-v/C-z standards
104+
;; au lieu de M-w/C-w/C-y/C-_ par défaut dans GNU Emacs
105+
(cua-mode 1)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ARG base=ocamlsf/learn-ocaml-client
2+
ARG version=master
3+
FROM ${base}:${version}
4+
5+
WORKDIR /home/learn-ocaml
6+
7+
USER root
8+
9+
RUN apk add --no-cache \
10+
curl \
11+
emacs-nox \
12+
&& mkdir -p -v bin \
13+
&& chown -v learn-ocaml:learn-ocaml bin
14+
15+
ENV PATH /home/learn-ocaml/bin:${PATH}
16+
17+
ENV LANG C.UTF-8
18+
# ENV LC_ALL C.UTF-8
19+
# ENV LANGUAGE en_US:en
20+
21+
COPY --chown=learn-ocaml:learn-ocaml .emacs .emacs
22+
23+
USER learn-ocaml
24+
25+
# Do some automatic Emacs installation/byte-compilation:
26+
RUN emacs --version && emacs --batch -l ${HOME}/.emacs
27+
28+
ENTRYPOINT []
29+
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)