-
Notifications
You must be signed in to change notification settings - Fork 26
55 lines (47 loc) · 1.75 KB
/
build-and-push-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
name: Build and Push Containers
on:
pull_request:
types:
- closed
paths:
- 'docker/auxiliary-containers/**/Dockerfile'
workflow_dispatch:
inputs:
container:
type: choice
description: The tag to update
required: true
options:
- gcb_playwright
jobs:
build-and-push-containers:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
## This is needed for multi-architecture builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
name: Build and Push auxiliary-containers (PR)
shell: bash
run: |
PR_FILES=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | jq -r '.[] | .filename')
CHANGED_SUBFOLDERS=$(echo "$PR_FILES" | grep -E '^docker/auxiliary-containers/[^/]+/' | sed -r 's|^docker/auxiliary-containers/([^/]+)/.*|\1|' | sort -u)
echo $CHANGED_SUBFOLDERS
./docker/auxiliary-containers/build-containers.sh $CHANGED_SUBFOLDERS
- if: github.event_name == 'workflow_dispatch'
name: Build and Push auxiliary-containers (manual)
shell: bash
run: |
./docker/auxiliary-containers/build-containers.sh ${{ github.event.inputs.container }}