Skip to content

Commit

Permalink
feat: build Docker image with haunt and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
evanp committed Oct 10, 2024
1 parent 72975d1 commit 3294471
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
paths:
- 'Dockerfile' # Only run when Dockerfile is updated

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Set up Docker Buildx (required for caching support)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Log in to the GitHub container registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Cache Docker layers
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# Build the Docker image with cache
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/swicg/haunt:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM ubuntu:latest

# Install guix

RUN apt-get update && apt-get install -y \
wget \
gperf \
build-essential \
guile-2.2 \
guile-2.2-dev \
guile-2.2-libs

WORKDIR /usr/src

# Install guile-reader

RUN wget https://download.savannah.nongnu.org/releases/guile-reader/guile-reader-0.6.3.tar.gz
RUN tar -xvf guile-reader-0.6.3.tar.gz
RUN cd guile-reader-0.6.3 && ./configure --prefix=/usr && make && make install

# Install guile-commonmark

RUN wget https://github.com/OrangeShark/guile-commonmark/releases/download/v0.1.2/guile-commonmark-0.1.2.tar.gz
RUN tar -xvf guile-commonmark-0.1.2.tar.gz
RUN cd guile-commonmark-0.1.2 && ./configure --prefix=/usr && make && make install

# Install guile-sjson

RUN wget https://gitlab.com/dustyweb/guile-sjson/-/archive/v0.2.2/guile-sjson-v0.2.2.tar.gz
RUN tar -xvf guile-sjson-v0.2.2.tar.gz
RUN cd guile-sjson-v0.2.2 && autoreconf --install && ./configure --prefix=/usr && make && make install

# Install haunt

RUN wget https://files.dthompson.us/releases/haunt/haunt-0.3.0.tar.gz
RUN tar -xvf haunt-0.3.0.tar.gz
RUN cd haunt-0.3.0 && ./configure --prefix=/usr && make && make install

# Install guile-sjson

CMD ["sh", "-c", "sleep infinity & exec sh"]

0 comments on commit 3294471

Please sign in to comment.