-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (127 loc) · 3.58 KB
/
build_containers.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Creating container images
run-name: Creating container images 🧉
# Set the access for individual scopes, or use permissions: write-all
permissions:
pull-requests: write
contents: write
packages: write
# on:
# pull_request:
# types: [closed]
# branches:
# - main
on:
push:
branches: ["**"]
tags:
- "v*.*.*"
jobs:
deployment-image-linux:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
-
name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Python 3.X
uses: actions/setup-python@v4
with:
python-version: "3.X"
-
name: Get tag
id: repository
run: |
echo "tag=$(python src/freva_deployment/__init__.py -v)" >> $GITHUB_OUTPUT
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
-
name: Create Buildx builder
run: docker buildx create --use --name mybuilder --driver docker-container
-
name: Inspect Buildx builder
run: docker buildx inspect --bootstrap
-
name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push deployment image
uses: docker/build-push-action@v4
with:
push: true
build-args: VERSION=${{steps.repository.outputs.tag}}
tags: |
ghcr.io/freva-clint/freva-deployment:${{ steps.repository.outputs.tag }}
ghcr.io/freva-clint/freva-deployment:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/i386,linux/s390x
build-and-push-vault-image:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
-
name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Python 3.X
uses: actions/setup-python@v4
with:
python-version: "3.X"
-
name: Get tag
id: repository
run: |
echo "tag=$(python src/freva_deployment/__init__.py -v)" >> $GITHUB_OUTPUT
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
-
name: Create Buildx builder
run: docker buildx create --use --name mybuilder --driver docker-container
-
name: Inspect Buildx builder
run: docker buildx inspect --bootstrap
-
name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push vault image
uses: docker/build-push-action@v4
with:
context: assets/share/freva/deployment/vault/
platforms: linux/amd64,linux/arm64
push: true
build-args: VERSION=${{steps.repository.outputs.tag}}
tags: |
ghcr.io/freva-clint/freva-vault:${{ steps.repository.outputs.tag }}
ghcr.io/freva-clint/freva-vault:latest