-
Notifications
You must be signed in to change notification settings - Fork 7
103 lines (100 loc) · 3.72 KB
/
push.yml
File metadata and controls
103 lines (100 loc) · 3.72 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build Artifacts
permissions:
contents: read
packages: write
actions: read
on:
workflow_dispatch: {}
# release:
# types: [created]
# push:
# branches:
# - '**'
# paths-ignore:
# - 'docs/**'
# - 'CODE-OF-CONDUCT.md'
# - 'CONTRIBUTING.md'
# - 'LICENSE'
# - 'README.md'
# - 'SECURITY.md'
# pull_request:
# branches:
# - '**'
# paths-ignore:
# - 'docs/**'
# - 'CODE-OF-CONDUCT.md'
# - 'CONTRIBUTING.md'
# - 'LICENSE'
# - 'README.md'
# - 'SECURITY.md'
env:
TAG_NAME: ${{ github.event.release.tag_name || github.ref }}
GITHUB_GROUP: ${{ github.repository_owner }}
concurrency:
# On main/release, we don't want any jobs cancelled so the sha is used to name the group
# On PR branches, we cancel the job if new commits are pushed
# More info: https://stackoverflow.com/a/68422069/253468
group: ${{ github.ref == 'refs/heads/main' && format('ci-main-{0}', github.sha) || format('ci-main-{0}', github.ref) }}
cancel-in-progress: true
jobs:
multiplatform_build:
if: github.event.pull_request.user.login != 'dependabot[bot]' || github.event_name == 'pull_request'
strategy:
fail-fast: false
matrix:
component:
- name: qubership-zookeeper-integration-tests
file: integration-tests/docker/Dockerfile
context: integration-tests
- name: qubership-zookeeper-operator
file: operator/Dockerfile
context: operator
- name: qubership-zookeeper-transfer
file: docker-transfer/Dockerfile
context: ""
- name: qubership-zookeeper-backup-daemon
file: backup-daemon/docker/Dockerfile
context: backup-daemon
- name: qubership-zookeeper-monitoring
file: monitoring/docker/Dockerfile
context: monitoring
- name: qubership-docker-zookeeper
file: docker-zookeeper/docker/Dockerfile
context: docker-zookeeper
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # 3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${GITHUB_ACTOR}
password: ${{secrets.GITHUB_TOKEN}}
- name: Prepare Tag
run: echo "TAG_NAME=$(echo ${TAG_NAME} | sed 's@refs/tags/@@;s@refs/heads/@@;s@/@_@g')" >> $GITHUB_ENV
- name: Prepare Group
run: echo "GITHUB_GROUP=${GITHUB_GROUP,,}" >> $GITHUB_ENV
- name: Get package IDs for delete
id: get-ids-for-delete
uses: Netcracker/get-package-ids@84bc8eb8bed50218be76e671b3a24c35a1300979 # v0.0.1
with:
component-name: ${{ matrix.component.name }}
component-tag: ${{ env.TAG_NAME }}
access-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
no-cache: true
context: ${{ matrix.component.context }}
file: ${{ matrix.component.file }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
tags: ghcr.io/${{ env.GITHUB_GROUP }}/${{ matrix.component.name }}:${{ env.TAG_NAME }}
provenance: false