1
+ name : build-docker.yml
2
+ on :
3
+ push :
4
+ tags :
5
+ - " v*"
6
+ jobs :
7
+ docker :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - name : Checkout
11
+ uses : actions/checkout@v4
12
+
13
+ - name : Buildx cache
14
+ uses : actions/cache@v4
15
+ with :
16
+ path : buildx-cache
17
+ key : ${{ runner.os }}-buildx-${{ hashFiles('buildx-cache/**') }}
18
+ restore-keys : |
19
+ ${{ runner.os }}-buildx-
20
+
21
+ - name : Docker meta (oblivious)
22
+ id : metaOblivious
23
+ uses : docker/metadata-action@v5
24
+ with :
25
+ images : ghcr.io/gatenlp/stance-target-oblivious
26
+ tags : |
27
+ type=ref,event=branch
28
+ type=semver,pattern={{version}}
29
+ type=semver,pattern={{major}}.{{minor}}
30
+
31
+ - name : Docker meta (aware)
32
+ id : metaAware
33
+ uses : docker/metadata-action@v5
34
+ with :
35
+ images : ghcr.io/gatenlp/stance-target-aware
36
+ tags : |
37
+ type=ref,event=branch
38
+ type=semver,pattern={{version}}
39
+ type=semver,pattern={{major}}.{{minor}}
40
+
41
+ - name : Login to GitHub Container Registry
42
+ uses : docker/login-action@v3
43
+ with :
44
+ registry : ghcr.io
45
+ username : ${{ github.repository_owner }}
46
+ password : ${{ secrets.GITHUB_TOKEN }}
47
+
48
+ - name : Build and push target-oblivious
49
+ uses : docker/build-push-action@v6
50
+ with :
51
+ context : .
52
+ file : docker/Dockerfile
53
+ target : oblivious
54
+ push : true
55
+ tags : ${{ steps.metaOblivious.outputs.tags }}
56
+ labels : ${{ steps.metaOblivious.outputs.labels }}
57
+ cache-from : type=local,src=buildx-cache
58
+ cache-to : type=local,dest=buildx-cache-out,mode=max
59
+ platforms : linux/amd64
60
+
61
+ - name : Build and push target-aware
62
+ uses : docker/build-push-action@v6
63
+ with :
64
+ context : .
65
+ file : docker/Dockerfile
66
+ target : ensemble
67
+ push : true
68
+ tags : ${{ steps.metaAware.outputs.tags }}
69
+ labels : ${{ steps.metaAware.outputs.labels }}
70
+ cache-from : type=local,src=buildx-cache
71
+ platforms : linux/amd64
72
+
73
+ - name : Clean up cache
74
+ run : rm -rf buildx-cache && mv buildx-cache-out buildx-cache
0 commit comments