Skip to content

Commit 9557f1d

Browse files
committed
build docker containers in CI
We now build `base`, `build` and `formosa` containers in CI, and push them to GHCR. This is done for the `main` and `release` branches, as well as for tagged releases (`ryyyy.mm`). Containers are tagged with the originating branch or tag when pushed. This ensures that the software environment for building EasyCrypt (and Jasmin, in the `formosa` container) is captured at time of release.
1 parent b54944b commit 9557f1d

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

.github/workflows/docker.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: EasyCrypt Docker Containers Build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'release'
8+
tags:
9+
- 'r[0-9]+.[0-9]+'
10+
workflow_dispatch:
11+
12+
jobs:
13+
make-images:
14+
name: Build and Push Container Images
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
packages: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Build `base` Image
22+
run: TAG=${{ github.ref_name }} VARIANT=base make -C scripts/docker
23+
24+
- name: Build `build` Image
25+
run: TAG=${{ github.ref_name }} VARIANT=build make -C scripts/docker
26+
27+
- name: Build `formosa` Image
28+
run: TAG=${{ github.ref_name }} VARIANT=formosa make -C scripts/docker
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
32+
with:
33+
registry: https://ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Push All Images
38+
run: |
39+
TAG=${{ github.ref_name }} VARIANT=base make -C scripts/docker publish
40+
TAG=${{ github.ref_name }} VARIANT=build make -C scripts/docker publish
41+
TAG=${{ github.ref_name }} VARIANT=formosa make -C scripts/docker publish

scripts/docker/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# --------------------------------------------------------------------
44
VARIANT ?= build
5+
TAG ?= main
56

67
# --------------------------------------------------------------------
78
.PHONY: default build publish
@@ -11,8 +12,8 @@ default: build
1112
build:
1213
docker build -f Dockerfile.$(VARIANT) \
1314
--platform linux/amd64 \
14-
-t ghcr.io/easycrypt/ec-$(VARIANT)-box \
15+
-t ghcr.io/easycrypt/ec-$(VARIANT)-box:$(TAG) \
1516
.
1617

1718
publish:
18-
docker push ghcr.io/easycrypt/ec-$(VARIANT)-box
19+
docker push ghcr.io/easycrypt/ec-$(VARIANT)-box:$(TAG)

0 commit comments

Comments
 (0)