forked from devops-infra/docker-terragrunt
-
Notifications
You must be signed in to change notification settings - Fork 0
214 lines (189 loc) · 6.42 KB
/
PUSH-OTHER.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Push to other branches
on:
push:
branches-ignore:
- master
jobs:
labels:
name: Repo labels
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Labels' config
shell: bash
run: |
mkdir -p .tmp
curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/.github/labels.yml -o .tmp/labels.yml
- name: Update labels (dry run)
uses: crazy-max/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .tmp/labels.yml
dry-run: true
lint:
name: Linters
if: "!startsWith(github.ref, 'refs/heads/dependabot')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Hadolint
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
# build_and_push:
# name: Build & push
# if: "!startsWith(github.ref, 'refs/heads/dependabot')"
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# flavour: [slim, plain, aws, azure, gcp, aws-azure, aws-gcp, azure-gcp, aws-azure-gcp, yc]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Docker Buildx
# uses: docker/[email protected]
# with:
# install: true
#
# - name: QEMU
# uses: docker/[email protected]
# with:
# image: tonistiigi/binfmt:latest
# platforms: amd64,arm64
#
# - name: Build & push
# env:
# DOCKER_BUILDKIT: 1
# DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TERM: xterm-256color
# run: make push-${{ matrix.flavour }} VERSION_PREFIX=test-
build_and_push:
name: Build & push
if: "!startsWith(github.ref, 'refs/heads/dependabot')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Buildx
uses: docker/[email protected]
with:
install: true
- name: QEMU
uses: docker/[email protected]
with:
image: tonistiigi/binfmt:latest
platforms: amd64,arm64
- name: Build aws-azure-gcp
env:
DOCKER_BUILDKIT: 1
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERM: xterm-256color
run: make build-aws-azure-gcp VERSION_PREFIX=test-
- name: Build yc
env:
DOCKER_BUILDKIT: 1
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERM: xterm-256color
run: make build-yc VERSION_PREFIX=test-
build_dependabot:
name: Dependabot build
if: "startsWith(github.ref, 'refs/heads/dependabot')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Buildx
uses: docker/[email protected]
with:
install: true
- name: QEMU
uses: docker/[email protected]
with:
image: tonistiigi/binfmt:latest
platforms: amd64,arm64
- name: Build
env:
DOCKER_BUILDKIT: 1
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERM: xterm-256color
run: make build-aws-azure-gcp VERSION_PREFIX=test-
pull_request:
name: Create Pull Request
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "curr_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Template
shell: bash
run: |
mkdir -p .tmp
curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/PULL_REQUEST_TEMPLATE.md -o .tmp/PULL_REQUEST_TEMPLATE.md
- name: PR - bugfix (conditional)
if: startsWith(github.ref, 'refs/heads/bugfix')
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
label: bugfix
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true
- name: PR - dependency (conditional)
if: startsWith(github.ref, 'refs/heads/dependency')
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
label: dependency
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true
- name: PR - documentation (conditional)
if: startsWith(github.ref, 'refs/heads/documentation')
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
label: documentation
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true
- name: PR - feature (conditional)
if: startsWith(github.ref, 'refs/heads/feature')
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
label: feature
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true
- name: PR - test (conditional)
if: startsWith(github.ref, 'refs/heads/test')
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
reviewer: ${{ github.actor }}
label: test
template: .tmp/PULL_REQUEST_TEMPLATE.md
draft: true
get_diff: true
- name: PR - other (conditional)
if: "!startsWith(github.ref, 'refs/heads/bugfix') && !startsWith(github.ref, 'refs/heads/dependabot') && !startsWith(github.ref, 'refs/heads/dependency') && !startsWith(github.ref, 'refs/heads/documentation') && !startsWith(github.ref, 'refs/heads/feature') && !startsWith(github.ref, 'refs/heads/test')"
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
label: feature
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true