Skip to content

Commit 81e6277

Browse files
authored
feat(ci): automate the creation of emacs-builder image - fix #4 (#13)
1 parent d69d766 commit 81e6277

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
schedule:
3+
- cron: "30 11 * * 0"
4+
5+
jobs:
6+
image:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout the repo
10+
uses: actions/checkout@v2
11+
- name: Import environment variables
12+
shell: bash
13+
run: |
14+
while read line; do
15+
echo "$line" >> $GITHUB_ENV
16+
done < assets/variables
17+
- name: Set up Docker buildx
18+
id: buildx
19+
uses: docker/setup-buildx-action@master
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v1
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
25+
- name: Build and push Docker image
26+
uses: docker/build-push-action@v2
27+
with:
28+
context: .
29+
file: ./Dockerfile
30+
builder: ${{ steps.buildx.outputs.name }}
31+
push: true
32+
tags: mpsq/emacs-builder:latest
33+
build-args: |
34+
UPSTREAM_BRANCH=${{ env.UPSTREAM_BRANCH }}
35+
UPSTREAM_REPO=${{ env.UPSTREAM_REPO }}
36+
USR=${{ env.USR }}
37+
USR_HOME=${{ env.USR_HOME }}

Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
#
22
# This Dockerfile is used to build the image "mpsq/emacs-builder".
3-
# Link: https://hub.docker.com/repository/docker/mpsq/emacs-builder
3+
# https://hub.docker.com/repository/docker/mpsq/emacs-builder
44
#
5-
# What is the point of this?
6-
# - Have an Archlinux environment
7-
# - Pull and compile Emacs so it is much faster to produce subsequent binaries
8-
#
9-
# This image is obviously then used in the GitHub action to compile Emacs.
10-
#
11-
# At the moment, this image is built manually from times to times (= very
12-
# infrequently). In the future, I might get CI to do it, maybe on a monthly
13-
# basis.
5+
# This image is then used in GitHub actions to compile Emacs.
146
#
157
FROM archlinux:base-devel
168

@@ -71,6 +63,8 @@ USER $USR
7163

7264
SHELL ["/bin/bash", "-c"]
7365

66+
# We compile Emacs in order to cache artifacts in the image and get better
67+
# compilation time in subsequent builds.
7468
RUN \
7569
cp /scripts/pull.bash . && \
7670
cp /assets/PKGBUILD . && \

0 commit comments

Comments
 (0)