forked from greenbone/gvmd
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (67 loc) · 2.18 KB
/
container.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
name: Container Image Builds
on:
push:
branches: [ main ]
tags: ["v*"]
workflow_dispatch:
jobs:
images:
name: Build and upload container images
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Gather container image tags
id: container
uses: greenbone/actions/container-image-tags@v1
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Container image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.container.outputs.image-tags }}
file: .docker/prod.Dockerfile
upload-build:
name: "Upload images for building gvmd"
runs-on: ubuntu-latest
strategy:
matrix:
compiler:
- gcc
- clang
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Gather container image names
uses: greenbone/actions/container-image-tags@v1
id: container
with:
image-name: ${{ github.repository }}-${{matrix.compiler}}-build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: echo "Build and push ${{ steps.container.outputs.image-tags }}"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.container.outputs.image-tags }}
file: .docker/build.Dockerfile
build-args: |
COMPILER=${{matrix.compiler}}
- name: Trigger libtheia container build
run: |
curl -X POST https://api.github.com/repos/greenbone/libtheia/actions/workflows/container.yml/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-u greenbonebot:${{ secrets.GREENBONE_BOT_TOKEN }} \
-d '{"ref":"main"}'