-
Notifications
You must be signed in to change notification settings - Fork 36
99 lines (87 loc) · 2.93 KB
/
build-containers.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: "build containers"
on:
push:
branches:
- master
- develop
pull_request:
branches:
- develop
- master
release:
types: [published]
jobs:
build-containers:
runs-on: ubuntu-20.04
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Docker meta fedn
id: meta1
uses: docker/metadata-action@v4
with:
images: |
docker.pkg.github.com/${{ github.repository }}/fedn
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Docker meta mnist-keras
id: meta2
uses: docker/metadata-action@v4
with:
images: |
docker.pkg.github.com/${{ github.repository }}/fedn
tags: |
type=ref,event=branch,suffix=-mnist-keras
type=ref,event=pr,suffix=-mnist-keras
type=semver,pattern={{version}},suffix=-mnist-keras
type=semver,pattern={{major}}.{{minor}},suffix=-mnist-keras
type=sha,suffix=-mnist-keras
- name: Docker meta mnist-pytorch
id: meta3
uses: docker/metadata-action@v4
with:
images: |
docker.pkg.github.com/${{ github.repository }}/fedn
tags: |
type=ref,event=branch,suffix=-mnist-pytorch
type=ref,event=pr,suffix=-mnist-pytorch
type=semver,pattern={{version}},suffix=-mnist-pytorch
type=semver,pattern={{major}}.{{minor}},suffix=-mnist-pytorch
type=sha,suffix=-mnist-pytorch
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: "${{ github.event_name != 'pull_request' }}"
tags: ${{ steps.meta1.outputs.tags }}
labels: ${{ steps.meta1.outputs.labels }}
file: Dockerfile
- name: Build and push (mnist-keras)
uses: docker/build-push-action@v4
with:
push: "${{ github.event_name != 'pull_request' }}"
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
file: Dockerfile
build-args: |
REQUIREMENTS=examples/mnist-keras/requirements.txt
- name: Build and push (mnist-pytorch)
uses: docker/build-push-action@v4
with:
push: "${{ github.event_name != 'pull_request' }}"
tags: ${{ steps.meta3.outputs.tags }}
labels: ${{ steps.meta3.outputs.labels }}
file: Dockerfile
build-args: |
REQUIREMENTS=examples/mnist-pytorch/requirements.txt