-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build Docker image with haunt and dependencies
- Loading branch information
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |