-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (59 loc) · 1.96 KB
/
container-gpg-data.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
name: GPG Data Container Image Builds
on:
push:
branches: [ main ]
tags: ["v*"]
path:
- gpg-data/*
- .github/workflows/container-gpg-data.yml
pull_request:
branches: [ main ]
path:
- gpg-data/*
- .github/workflows/container-gpg-data.yml
workflow_dispatch:
schedule:
# rebuild image every sunday
- cron: "0 0 * * 0"
jobs:
gpg-data-images:
name: Build and upload container images with gpg data
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup container meta information
id: meta
uses: docker/metadata-action@v4
with:
images: greenbone/gpg-data
labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.documentation=https://greenbone.github.io/docs/
org.opencontainers.image.base.name=busybox:stable
flavor: latest=false # no latest container tag for git tags
tags: |
# create container tag for git tags
type=ref,event=tag
type=ref,event=pr
# set latest for main branch pushes
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Container image
uses: docker/build-push-action@v4
with:
context: gpg-data
push: ${{ github.event_name != 'pull_request' }}
file: gpg-data/Dockerfile
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}