forked from ViaQ/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.36 KB
/
soak_infra.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
# Build soak test infra
#
# This workflow builds our soak test infrastructure. The image here is
# built on a push to master branch that update the 'lib/soak' directory.
name: Soak Infra
on:
pull_request:
paths:
- 'lib/soak'
- 'soaks/Dockerfile'
- 'soaks/Dockerfile.builder'
- '.github/workflows/soak_infra.yml'
push:
branches:
- master
paths:
- 'lib/soak'
- 'soaks/Dockerfile'
- 'soaks/Dockerfile.builder'
- '.github/workflows/soak_infra.yml'
jobs:
cancel-previous:
runs-on: ubuntu-20.04
timeout-minutes: 3
if: github.ref != 'refs/heads/master'
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
all_but_latest: true # can cancel workflows scheduled later
soak-builder:
name: Build and push 'soak-builder' (${{ matrix.platform }})
runs-on: ubuntu-20.04
strategy:
matrix:
platform: [linux/amd64, linux/arm64]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@e5622373a38e60fb6d795a4421e56882f2d7a681
with:
images: ghcr.io/${{ github.repository }}/soak-builder
flavor: |
latest=true
tags: type=sha, format=long
labels: |
org.opencontainers.image.description=Base image for use with building soak-vector images
org.opencontainers.image.title=Soak Builder
- name: Build and push Docker image (linux/amd64)
uses: docker/[email protected]
with:
context: .
file: soaks/Dockerfile.builder
push: ${{ github.ref == 'refs/heads/master' }}
platforms: ${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max