Skip to content

Commit 2f1bc10

Browse files
committed
prepare for docker builds in CI
1 parent b46c8c7 commit 2f1bc10

2 files changed

Lines changed: 61 additions & 2 deletions

File tree

.github/workflows/docker.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: EasyCrypt Docker Containers Build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'stable'
7+
- 'testing'
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 `base` Image
38+
run: TAG=${{ github.ref_name }} VARIANT=base make -C scripts/docker publish
39+
40+
- name: Log in to the Container registry
41+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
42+
with:
43+
registry: https://ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Push `build` Image
48+
run: TAG=${{ github.ref_name }} VARIANT=build make -C scripts/docker publish
49+
50+
- name: Log in to the Container registry
51+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
52+
with:
53+
registry: https://ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Push `formosa` Image
58+
run: 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)