-
Notifications
You must be signed in to change notification settings - Fork 9
89 lines (80 loc) · 2.93 KB
/
auto-release.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
name: Docker Image CI
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Get the repository's code
- name: Checkout
uses: actions/checkout@v3
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker meta
id: dockeraction # you'll use this in the next step
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
logzio/fluent-bit-output
flavor: |
latest=false
# Docker tags based on the following events/attributes
- name: Build and push amd64
uses: docker/build-push-action@v2
with:
context: .
file: ./test/Dockerfile.amd
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.dockeraction.outputs.tags }}-amd
labels: ${{ steps.dockeraction.outputs.labels }}
- name: Build and push amd64 latest
uses: docker/build-push-action@v4
with:
context: .
file: ./test/Dockerfile.amd
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: logzio/fluent-bit-output:latest-amd
labels: ${{ steps.dockeraction.outputs.labels }}
- name: Build and push arm64 latest
uses: docker/build-push-action@v4
with:
context: .
file: ./test/Dockerfile.arm
platforms: linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: logzio/fluent-bit-output:latest-arm
labels: ${{ steps.dockeraction.outputs.labels }}
- name: Build and push arm64
uses: docker/build-push-action@v4
with:
context: .
file: ./test/Dockerfile.arm
platforms: linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.dockeraction.outputs.tags }}-arm
labels: ${{ steps.dockeraction.outputs.labels }}
- name: Create manifest version
run: |
docker buildx imagetools create -t ${{ steps.dockeraction.outputs.tags }} \
${{ steps.dockeraction.outputs.tags }}-arm \
${{ steps.dockeraction.outputs.tags }}-amd
- name: Create manifest latest
run: |
docker buildx imagetools create -t logzio/fluent-bit-output:latest \
logzio/fluent-bit-output:latest-arm \
logzio/fluent-bit-output:latest-amd